1
|
1 # required to link the GLSL compiler
|
|
2 when defined(release):
|
|
3 {.passl: "-Lthirdparty/glslang/lib/release" .}
|
|
4 else:
|
|
5 {.passl: "-Lthirdparty/glslang/lib/debug" .}
|
|
6 {.passl: "-Lthirdparty/spirv-tools/lib/" .}
|
|
7
|
|
8 {.passl: "-lglslang" .}
|
|
9 {.passl: "-lglslang-default-resource-limits" .}
|
|
10 {.passl: "-lHLSL" .}
|
|
11 {.passl: "-lMachineIndependent" .}
|
|
12 {.passl: "-lGenericCodeGen" .}
|
|
13 {.passl: "-lOSDependent" .}
|
|
14 {.passl: "-lOGLCompiler" .}
|
|
15 {.passl: "-lSPIRV" .}
|
|
16 {.passl: "-lSPIRV-Tools-opt" .}
|
|
17
|
|
18 {.passl: "-lSPIRV-Tools" .}
|
|
19 {.passl: "-lSPIRV-Tools-diff" .}
|
|
20 {.passl: "-lSPIRV-Tools-fuzz" .}
|
|
21 {.passl: "-lSPIRV-Tools-link" .}
|
|
22 {.passl: "-lSPIRV-Tools-lint" .}
|
|
23 {.passl: "-lSPIRV-Tools-opt" .}
|
|
24 {.passl: "-lSPIRV-Tools-reduce" .}
|
|
25
|
|
26 {.passl: "-lstdc++" .}
|
|
27 {.passl: "-lm" .}
|
|
28
|
0
|
29 import
|
|
30 glslang_c_shader_types
|
|
31
|
1
|
32 type
|
|
33 glslang_shader_t* {.nodecl incompleteStruct.} = object
|
|
34 glslang_program_t* {.nodecl incompleteStruct.} = object
|
0
|
35 glslang_limits_t* {.bycopy.} = object
|
|
36 non_inductive_for_loops*: bool
|
|
37 while_loops*: bool
|
|
38 do_while_loops*: bool
|
|
39 general_uniform_indexing*: bool
|
|
40 general_attribute_matrix_vector_indexing*: bool
|
|
41 general_varying_indexing*: bool
|
|
42 general_sampler_indexing*: bool
|
|
43 general_variable_indexing*: bool
|
|
44 general_constant_matrix_vector_indexing*: bool
|
|
45 glslang_resource_t* {.bycopy.} = object
|
|
46 max_lights*: cint
|
|
47 max_clip_planes*: cint
|
|
48 max_texture_units*: cint
|
|
49 max_texture_coords*: cint
|
|
50 max_vertex_attribs*: cint
|
|
51 max_vertex_uniform_components*: cint
|
|
52 max_varying_floats*: cint
|
|
53 max_vertex_texture_image_units*: cint
|
|
54 max_combined_texture_image_units*: cint
|
|
55 max_texture_image_units*: cint
|
|
56 max_fragment_uniform_components*: cint
|
|
57 max_draw_buffers*: cint
|
|
58 max_vertex_uniform_vectors*: cint
|
|
59 max_varying_vectors*: cint
|
|
60 max_fragment_uniform_vectors*: cint
|
|
61 max_vertex_output_vectors*: cint
|
|
62 max_fragment_input_vectors*: cint
|
|
63 min_program_texel_offset*: cint
|
|
64 max_program_texel_offset*: cint
|
|
65 max_clip_distances*: cint
|
|
66 max_compute_work_group_count_x*: cint
|
|
67 max_compute_work_group_count_y*: cint
|
|
68 max_compute_work_group_count_z*: cint
|
|
69 max_compute_work_group_size_x*: cint
|
|
70 max_compute_work_group_size_y*: cint
|
|
71 max_compute_work_group_size_z*: cint
|
|
72 max_compute_uniform_components*: cint
|
|
73 max_compute_texture_image_units*: cint
|
|
74 max_compute_image_uniforms*: cint
|
|
75 max_compute_atomic_counters*: cint
|
|
76 max_compute_atomic_counter_buffers*: cint
|
|
77 max_varying_components*: cint
|
|
78 max_vertex_output_components*: cint
|
|
79 max_geometry_input_components*: cint
|
|
80 max_geometry_output_components*: cint
|
|
81 max_fragment_input_components*: cint
|
|
82 max_image_units*: cint
|
|
83 max_combined_image_units_and_fragment_outputs*: cint
|
|
84 max_combined_shader_output_resources*: cint
|
|
85 max_image_samples*: cint
|
|
86 max_vertex_image_uniforms*: cint
|
|
87 max_tess_control_image_uniforms*: cint
|
|
88 max_tess_evaluation_image_uniforms*: cint
|
|
89 max_geometry_image_uniforms*: cint
|
|
90 max_fragment_image_uniforms*: cint
|
|
91 max_combined_image_uniforms*: cint
|
|
92 max_geometry_texture_image_units*: cint
|
|
93 max_geometry_output_vertices*: cint
|
|
94 max_geometry_total_output_components*: cint
|
|
95 max_geometry_uniform_components*: cint
|
|
96 max_geometry_varying_components*: cint
|
|
97 max_tess_control_input_components*: cint
|
|
98 max_tess_control_output_components*: cint
|
|
99 max_tess_control_texture_image_units*: cint
|
|
100 max_tess_control_uniform_components*: cint
|
|
101 max_tess_control_total_output_components*: cint
|
|
102 max_tess_evaluation_input_components*: cint
|
|
103 max_tess_evaluation_output_components*: cint
|
|
104 max_tess_evaluation_texture_image_units*: cint
|
|
105 max_tess_evaluation_uniform_components*: cint
|
|
106 max_tess_patch_components*: cint
|
|
107 max_patch_vertices*: cint
|
|
108 max_tess_gen_level*: cint
|
|
109 max_viewports*: cint
|
|
110 max_vertex_atomic_counters*: cint
|
|
111 max_tess_control_atomic_counters*: cint
|
|
112 max_tess_evaluation_atomic_counters*: cint
|
|
113 max_geometry_atomic_counters*: cint
|
|
114 max_fragment_atomic_counters*: cint
|
|
115 max_combined_atomic_counters*: cint
|
|
116 max_atomic_counter_bindings*: cint
|
|
117 max_vertex_atomic_counter_buffers*: cint
|
|
118 max_tess_control_atomic_counter_buffers*: cint
|
|
119 max_tess_evaluation_atomic_counter_buffers*: cint
|
|
120 max_geometry_atomic_counter_buffers*: cint
|
|
121 max_fragment_atomic_counter_buffers*: cint
|
|
122 max_combined_atomic_counter_buffers*: cint
|
|
123 max_atomic_counter_buffer_size*: cint
|
|
124 max_transform_feedback_buffers*: cint
|
|
125 max_transform_feedback_interleaved_components*: cint
|
|
126 max_cull_distances*: cint
|
|
127 max_combined_clip_and_cull_distances*: cint
|
|
128 max_samples*: cint
|
|
129 max_mesh_output_vertices_nv*: cint
|
|
130 max_mesh_output_primitives_nv*: cint
|
|
131 max_mesh_work_group_size_x_nv*: cint
|
|
132 max_mesh_work_group_size_y_nv*: cint
|
|
133 max_mesh_work_group_size_z_nv*: cint
|
|
134 max_task_work_group_size_x_nv*: cint
|
|
135 max_task_work_group_size_y_nv*: cint
|
|
136 max_task_work_group_size_z_nv*: cint
|
|
137 max_mesh_view_count_nv*: cint
|
|
138 max_mesh_output_vertices_ext*: cint
|
|
139 max_mesh_output_primitives_ext*: cint
|
|
140 max_mesh_work_group_size_x_ext*: cint
|
|
141 max_mesh_work_group_size_y_ext*: cint
|
|
142 max_mesh_work_group_size_z_ext*: cint
|
|
143 max_task_work_group_size_x_ext*: cint
|
|
144 max_task_work_group_size_y_ext*: cint
|
|
145 max_task_work_group_size_z_ext*: cint
|
|
146 max_mesh_view_count_ext*: cint
|
|
147 maxDualSourceDrawBuffersEXT*: cint
|
|
148 limits*: glslang_limits_t
|
|
149 glslang_input_t* {.bycopy.} = object
|
|
150 language*: glslang_source_t
|
|
151 stage*: glslang_stage_t
|
|
152 client*: glslang_client_t
|
|
153 client_version*: glslang_target_client_version_t
|
|
154 target_language*: glslang_target_language_t
|
|
155 target_language_version*: glslang_target_language_version_t
|
|
156 code*: cstring
|
|
157 default_version*: cint
|
|
158 default_profile*: glslang_profile_t
|
|
159 force_default_version_and_profile*: cint
|
|
160 forward_compatible*: cint
|
|
161 messages*: glslang_messages_t
|
|
162 resource*: ptr glslang_resource_t
|
|
163 glsl_include_result_t* {.bycopy.} = object
|
|
164 ## Header file name or NULL if inclusion failed
|
|
165 header_name*: cstring
|
|
166 ## Header contents or NULL
|
|
167 header_data*: cstring
|
|
168 header_length*: csize_t
|
1
|
169 glsl_include_local_func* = proc (ctx: pointer; header_name: cstring; includer_name: cstring; include_depth: csize_t): ptr glsl_include_result_t
|
|
170 glsl_include_system_func* = proc (ctx: pointer; header_name: cstring; includer_name: cstring; include_depth: csize_t): ptr glsl_include_result_t
|
|
171 glsl_free_include_result_func* = proc (ctx: pointer; result: ptr glsl_include_result_t): cint
|
0
|
172 glsl_include_callbacks_t* {.bycopy.} = object
|
|
173 include_system*: glsl_include_system_func
|
|
174 include_local*: glsl_include_local_func
|
|
175 free_include_result*: glsl_free_include_result_func
|
|
176 glslang_spv_options_t* {.bycopy.} = object
|
|
177 generate_debug_info*: bool
|
|
178 strip_debug_info*: bool
|
|
179 disable_optimizer*: bool
|
|
180 optimize_size*: bool
|
|
181 disassemble*: bool
|
|
182 validate*: bool
|
|
183 emit_nonsemantic_shader_debug_info*: bool
|
|
184 emit_nonsemantic_shader_debug_source*: bool
|
|
185
|
|
186 proc glslang_initialize_process*(): cint {.importc.}
|
|
187 proc glslang_finalize_process*() {.importc.}
|
|
188 proc glslang_shader_create*(input: ptr glslang_input_t): ptr glslang_shader_t {.importc.}
|
|
189 proc glslang_shader_delete*(shader: ptr glslang_shader_t) {.importc.}
|
|
190 proc glslang_shader_set_preamble*(shader: ptr glslang_shader_t; s: cstring) {.importc.}
|
|
191 proc glslang_shader_shift_binding*(shader: ptr glslang_shader_t; res: glslang_resource_type_t; base: cuint) {.importc.}
|
|
192 proc glslang_shader_shift_binding_for_set*(shader: ptr glslang_shader_t; res: glslang_resource_type_t; base: cuint; set: cuint) {.importc.}
|
|
193 proc glslang_shader_set_options*(shader: ptr glslang_shader_t; options: cint) {.importc.}
|
|
194
|
|
195 proc glslang_shader_set_glsl_version*(shader: ptr glslang_shader_t; version: cint) {.importc.}
|
|
196 proc glslang_shader_preprocess*(shader: ptr glslang_shader_t; input: ptr glslang_input_t): cint {.importc.}
|
|
197 proc glslang_shader_parse*(shader: ptr glslang_shader_t; input: ptr glslang_input_t): cint {.importc.}
|
|
198 proc glslang_shader_get_preprocessed_code*(shader: ptr glslang_shader_t): cstring {.importc.}
|
|
199 proc glslang_shader_get_info_log*(shader: ptr glslang_shader_t): cstring {.importc.}
|
|
200 proc glslang_shader_get_info_debug_log*(shader: ptr glslang_shader_t): cstring {.importc.}
|
|
201 proc glslang_program_create*(): ptr glslang_program_t {.importc.}
|
|
202 proc glslang_program_delete*(program: ptr glslang_program_t) {.importc.}
|
|
203 proc glslang_program_add_shader*(program: ptr glslang_program_t; shader: ptr glslang_shader_t) {.importc.}
|
|
204 proc glslang_program_link*(program: ptr glslang_program_t; messages: cint): cint {.importc.}
|
|
205
|
|
206 proc glslang_program_add_source_text*(program: ptr glslang_program_t; stage: glslang_stage_t; text: cstring; len: csize_t) {.importc.}
|
|
207 proc glslang_program_set_source_file*(program: ptr glslang_program_t; stage: glslang_stage_t; file: cstring) {.importc.}
|
|
208 proc glslang_program_map_io*(program: ptr glslang_program_t): cint {.importc.}
|
|
209 proc glslang_program_SPIRV_generate*(program: ptr glslang_program_t; stage: glslang_stage_t) {.importc.}
|
|
210 proc glslang_program_SPIRV_generate_with_options*(program: ptr glslang_program_t; stage: glslang_stage_t; spv_options: ptr glslang_spv_options_t) {.importc.}
|
|
211 proc glslang_program_SPIRV_get_size*(program: ptr glslang_program_t): csize_t {.importc.}
|
|
212 proc glslang_program_SPIRV_get*(program: ptr glslang_program_t; a2: ptr cuint) {.importc.}
|
|
213 proc glslang_program_SPIRV_get_ptr*(program: ptr glslang_program_t): ptr cuint {.importc.}
|
|
214 proc glslang_program_SPIRV_get_messages*(program: ptr glslang_program_t): cstring {.importc.}
|
|
215 proc glslang_program_get_info_log*(program: ptr glslang_program_t): cstring {.importc.}
|
|
216 proc glslang_program_get_info_debug_log*(program: ptr glslang_program_t): cstring {.importc.}
|
|
217
|
|
218 proc glslang_default_resource*(): ptr glslang_resource_t {.importc.}
|
|
219 proc glslang_default_resource_string*(): cstring {.importc.}
|
|
220 proc glslang_decode_resource_limits*(resources: ptr glslang_resource_t , config: cstring) {.importc.}
|