1# Copyright 2024 Valve Corporation 2# SPDX-License-Identifier: MIT 3 4libagx_shader_files = files( 5 'compression.cl', 6 'draws.cl', 7 'geometry.cl', 8 'query.cl', 9 'tessellation.cl', 10 'tessellator.cl', 11 'texture.cl', 12 'helper.cl', 13) 14 15prepended_input_args = [] 16foreach input_arg : libagx_shader_files 17 prepended_input_args += ['--in', input_arg] 18endforeach 19 20# We need to set -fmacro-prefix-map properly for reproducability. 21fs = import('fs') 22relative_dir = fs.relative_to(meson.global_source_root(), meson.global_build_root()) + '/' 23 24libagx_spv = custom_target( 25 'libagx.spv', 26 input : libagx_shader_files, 27 output : 'libagx.spv', 28 command : [ 29 prog_mesa_clc, 30 prepended_input_args, '-o', '@OUTPUT@', '--depfile', '@DEPFILE@', '--', 31 '-cl-std=cl2.0', '-D__OPENCL_VERSION__=200', 32 '-I' + join_paths(meson.current_source_dir(), '.'), 33 '-I' + join_paths(meson.current_source_dir(), '../../'), 34 '-I' + join_paths(meson.current_source_dir(), 'shaders'), 35 '-I' + join_paths(meson.current_build_dir(), '../genxml'), 36 '-fmacro-prefix-map=@0@='.format(relative_dir), 37 ], 38 env: ['MESA_SHADER_CACHE_DISABLE=true'], 39 depends : [prog_mesa_clc, agx_pack], 40 depfile : 'libagx_shaders.h.d', 41) 42 43libagx_h = custom_target( 44 'libagx.h', 45 input : libagx_spv, 46 output : 'libagx.h', 47 command : [prog_vtn_bindgen, libagx_spv, '@OUTPUT@'], 48 depends : [prog_vtn_bindgen], 49) 50 51idep_libagx = declare_dependency( 52 sources : [libagx_h], 53 include_directories : include_directories('.'), 54) 55