1 # Copyright © 2017 Intel Corporation
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 nir_depends = files('nir_opcodes.py', 'nir_intrinsics.py')
23 nir_builder_opcodes_h = custom_target(
24 'nir_builder_opcodes.h',
25 input : 'nir_builder_opcodes_h.py',
26 output : 'nir_builder_opcodes.h',
27 command : [prog_python, '@INPUT@'],
29 depend_files : nir_depends,
32 nir_constant_expressions_c = custom_target(
33 'nir_constant_expressions.c',
34 input : 'nir_constant_expressions.py',
35 output : 'nir_constant_expressions.c',
36 command : [prog_python, '@INPUT@'],
38 depend_files : nir_depends,
41 nir_opcodes_h = custom_target(
43 input : 'nir_opcodes_h.py',
44 output : 'nir_opcodes.h',
45 command : [prog_python, '@INPUT@'],
47 depend_files : nir_depends,
50 nir_opcodes_c = custom_target(
52 input : 'nir_opcodes_c.py',
53 output : 'nir_opcodes.c',
54 command : [prog_python, '@INPUT@'],
56 depend_files : nir_depends,
59 nir_opt_algebraic_c = custom_target(
60 'nir_opt_algebraic.c',
61 input : 'nir_opt_algebraic.py',
62 output : 'nir_opt_algebraic.c',
63 command : [prog_python, '@INPUT@'],
65 depend_files : files('nir_algebraic.py'),
68 nir_intrinsics_h = custom_target(
70 input : 'nir_intrinsics_h.py',
71 output : 'nir_intrinsics.h',
72 command : [prog_python, '@INPUT@', '--outdir', meson.current_build_dir()],
74 depend_files : files('nir_intrinsics.py'),
77 nir_intrinsics_c = custom_target(
79 input : 'nir_intrinsics_c.py',
80 output : 'nir_intrinsics.c',
81 command : [prog_python, '@INPUT@', '--outdir', meson.current_build_dir()],
83 depend_files : files('nir_intrinsics.py'),
90 'nir_builtin_builder.c',
91 'nir_builtin_builder.h',
93 'nir_constant_expressions.h',
96 'nir_control_flow_private.h',
100 'nir_format_convert.h',
103 'nir_gather_xfb_info.c',
104 'nir_gs_count_vertices.c',
105 'nir_inline_functions.c',
108 'nir_linking_helpers.c',
110 'nir_loop_analyze.c',
111 'nir_loop_analyze.h',
113 'nir_lower_alu_to_scalar.c',
114 'nir_lower_alpha_test.c',
115 'nir_lower_array_deref_of_vec.c',
116 'nir_lower_atomics_to_ssbo.c',
117 'nir_lower_bitmap.c',
118 'nir_lower_bool_to_float.c',
119 'nir_lower_bool_to_int32.c',
120 'nir_lower_clamp_color_outputs.c',
122 'nir_lower_clip_cull_distance_arrays.c',
123 'nir_lower_constant_initializers.c',
124 'nir_lower_double_ops.c',
125 'nir_lower_drawpixels.c',
126 'nir_lower_fb_read.c',
127 'nir_lower_fragcoord_wtrans.c',
129 'nir_lower_global_vars_to_local.c',
130 'nir_lower_gs_intrinsics.c',
131 'nir_lower_load_const_to_scalar.c',
132 'nir_lower_locals_to_regs.c',
134 'nir_lower_indirect_derefs.c',
137 'nir_lower_io_arrays_to_elements.c',
138 'nir_lower_io_to_temporaries.c',
139 'nir_lower_io_to_scalar.c',
140 'nir_lower_io_to_vector.c',
141 'nir_lower_non_uniform_access.c',
142 'nir_lower_packing.c',
143 'nir_lower_passthrough_edgeflags.c',
144 'nir_lower_patch_vertices.c',
145 'nir_lower_phis_to_scalar.c',
146 'nir_lower_regs_to_ssa.c',
147 'nir_lower_returns.c',
148 'nir_lower_scratch.c',
149 'nir_lower_subgroups.c',
150 'nir_lower_system_values.c',
152 'nir_lower_to_source_mods.c',
153 'nir_lower_two_sided_color.c',
154 'nir_lower_vars_to_ssa.c',
155 'nir_lower_var_copies.c',
156 'nir_lower_vec_to_movs.c',
157 'nir_lower_viewport_transform.c',
158 'nir_lower_wpos_center.c',
159 'nir_lower_wpos_ytransform.c',
160 'nir_lower_bit_size.c',
161 'nir_lower_uniforms_to_ubo.c',
163 'nir_move_load_const.c',
164 'nir_move_vec_src_uses_to_dest.c',
165 'nir_normalize_cubemap_coords.c',
166 'nir_opt_combine_stores.c',
167 'nir_opt_comparison_pre.c',
168 'nir_opt_conditional_discard.c',
169 'nir_opt_constant_folding.c',
170 'nir_opt_copy_prop_vars.c',
171 'nir_opt_copy_propagate.c',
175 'nir_opt_dead_write_vars.c',
176 'nir_opt_find_array_copies.c',
178 'nir_opt_idiv_const.c',
180 'nir_opt_intrinsics.c',
181 'nir_opt_large_constants.c',
182 'nir_opt_loop_unroll.c',
183 'nir_opt_move_comparisons.c',
184 'nir_opt_move_load_ubo.c',
185 'nir_opt_peephole_select.c',
186 'nir_opt_remove_phis.c',
187 'nir_opt_shrink_load.c',
188 'nir_opt_trivial_continues.c',
193 'nir_propagate_invariant.c',
194 'nir_remove_dead_variables.c',
198 'nir_search_helpers.h',
202 'nir_split_per_member_structs.c',
203 'nir_split_var_copies.c',
212 '../spirv/GLSL.ext.AMD.h',
213 '../spirv/GLSL.std.450.h',
214 '../spirv/gl_spirv.c',
215 '../spirv/nir_spirv.h',
216 '../spirv/OpenCL.std.h',
218 '../spirv/spirv_info.h',
219 '../spirv/spirv_to_nir.c',
220 '../spirv/vtn_alu.c',
221 '../spirv/vtn_amd.c',
222 '../spirv/vtn_cfg.c',
223 '../spirv/vtn_glsl450.c',
224 '../spirv/vtn_opencl.c',
225 '../spirv/vtn_private.h',
226 '../spirv/vtn_subgroup.c',
227 '../spirv/vtn_variables.c',
230 libnir = static_library(
232 [files_libnir, spirv_info_c, nir_opt_algebraic_c, nir_opcodes_c,
233 nir_opcodes_h, nir_constant_expressions_c, nir_builder_opcodes_h,
234 vtn_gather_types_c, nir_intrinsics_c, nir_intrinsics_h],
235 include_directories : [inc_common, inc_compiler, include_directories('../spirv')],
236 c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
237 link_with : libcompiler,
238 build_by_default : false,
241 # Headers-only dependency
242 idep_nir_headers = declare_dependency(
243 sources : [nir_opcodes_h, nir_builder_opcodes_h, nir_intrinsics_h],
244 include_directories : include_directories('.'),
248 idep_nir = declare_dependency(
249 dependencies : idep_nir_headers,
253 nir_algebraic_py = files('nir_algebraic.py')
259 'nir_control_flow_test',
260 files('tests/control_flow_tests.cpp'),
261 cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
262 include_directories : [inc_common],
263 dependencies : [dep_thread, idep_gtest, idep_nir],
264 link_with : libmesa_util,
266 suite : ['compiler', 'nir'],
273 files('tests/vars_tests.cpp'),
274 cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
275 include_directories : [inc_common],
276 dependencies : [dep_thread, idep_gtest, idep_nir],
277 link_with : libmesa_util,
279 suite : ['compiler', 'nir'],
282 'nir_algebraic_parser',
285 join_paths(meson.current_source_dir(), 'tests/algebraic_parser_test.py')
287 suite : ['compiler', 'nir'],
294 files('tests/negative_equal_tests.cpp'),
295 c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
296 include_directories : [inc_common],
297 dependencies : [dep_thread, idep_gtest, idep_nir],
298 link_with : libmesa_util,