xref: /aosp_15_r20/external/mesa3d/src/amd/vulkan/bvh/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2022 Konstantin Seurer
2# SPDX-License-Identifier: MIT
3
4# source file, output name, defines
5bvh_shaders = [
6  [
7    'copy.comp',
8    'copy',
9    [],
10  ],
11  [
12    'encode.comp',
13    'encode',
14    ['COMPACT=0'],
15  ],
16  [
17    'encode.comp',
18    'encode_compact',
19    ['COMPACT=1'],
20  ],
21  [
22    'header.comp',
23    'header',
24    [],
25  ],
26  [
27    'lbvh_generate_ir.comp',
28    'lbvh_generate_ir',
29    [],
30  ],
31  [
32    'lbvh_main.comp',
33    'lbvh_main',
34    [],
35  ],
36  [
37    'leaf.comp',
38    'leaf',
39    ['ALWAYS_ACTIVE=0'],
40  ],
41  [
42    'leaf.comp',
43    'leaf_always_active',
44    ['ALWAYS_ACTIVE=1'],
45  ],
46  [
47    'morton.comp',
48    'morton',
49    [],
50  ],
51  [
52    'ploc_internal.comp',
53    'ploc_internal',
54    [],
55  ],
56  [
57    'update.comp',
58    'update',
59    [],
60  ],
61]
62
63bvh_include_dir = dir_source_root + '/src/amd/vulkan/bvh'
64
65bvh_includes = files(
66  'build_helpers.h',
67  'build_interface.h',
68  'bvh.h',
69)
70
71bvh_spv = []
72foreach s : bvh_shaders
73  command = [
74    prog_glslang, '-V', '-I' + bvh_include_dir, '--target-env', 'spirv1.5',
75    '-x', '-o', '@OUTPUT@', '@INPUT@', glslang_depfile, glslang_quiet,
76  ]
77
78  foreach define : s[2]
79    command += '-D' + define
80  endforeach
81
82  _bvh_name = '@[email protected]'.format(s[1])
83  bvh_spv += custom_target(
84    _bvh_name,
85    input : s[0],
86    output : _bvh_name,
87    command : command,
88    depfile : f'@[email protected]',
89    depend_files: bvh_includes
90  )
91endforeach
92