diff --git a/meson.build b/meson.build index 07a677539a2..bb2c5d11067 100644 --- a/meson.build +++ b/meson.build @@ -306,24 +306,26 @@ with_any_broadcom = [ with_broadcom_vk, ].contains(true) -if get_option('intel-clc') != 'system' and get_option('precomp-compiler') != 'system' +with_intel_vk_rt = get_option('intel-rt') \ + .disable_auto_if(not with_intel_vk) \ + .disable_if(get_option('intel-bvh-grl') and \ + host_machine.cpu_family() != 'x86_64', \ + error_message : 'Intel Ray Tracing is only supported on x86_64') \ + .allowed() + +with_intel_bvh_grl = get_option('intel-bvh-grl') + +if get_option('intel-clc') != 'system' and \ + get_option('precomp-compiler') != 'system' and \ + with_intel_bvh_grl # Require intel-clc with Anv & Iris (for internal shaders) with_intel_clc = get_option('intel-clc') == 'enabled' or \ get_option('precomp-compiler') == 'enabled' or \ - with_intel_vk or with_gallium_iris + with_intel_bvh_grl else with_intel_clc = false endif -with_intel_vk_rt = get_option('intel-rt') \ - .disable_auto_if(not with_intel_vk) \ - .disable_if(host_machine.cpu_family() != 'x86_64', error_message : 'Intel Ray Tracing is only supported on x86_64') \ - .allowed() - -if with_intel_vk_rt - with_intel_bvh_grl = get_option('intel-bvh-grl') -endif - with_any_intel = [ with_gallium_crocus, with_gallium_i915, @@ -825,7 +827,18 @@ else with_drivers_clc = false endif -with_clc = get_option('mesa-clc') != 'auto' or with_microsoft_clc or with_intel_vk or with_gallium_iris or with_drivers_clc or with_gallium_asahi or with_asahi_vk or with_gallium_rusticl +if get_option('mesa-clc') == 'system' + prog_mesa_clc = find_program('mesa_clc', native : true) + prog_vtn_bindgen = find_program('vtn_bindgen', native : true) + # Even with mesa-clc already built, rusticl still needs clc. + with_clc = with_gallium_rusticl +else + with_clc = get_option('mesa-clc') != 'auto' or \ + with_microsoft_clc or with_drivers_clc or \ + with_gallium_iris or with_intel_vk or \ + with_gallium_asahi or with_asahi_vk or \ + with_gallium_rusticl +endif dep_clc = null_dep if with_gallium_clover or with_clc diff --git a/src/compiler/clc/meson.build b/src/compiler/clc/meson.build index 4875d71ca21..c11b707d4ff 100644 --- a/src/compiler/clc/meson.build +++ b/src/compiler/clc/meson.build @@ -117,9 +117,11 @@ idep_mesaclc = declare_dependency( link_args : _idep_mesaclc_link_args, ) -if get_option('mesa-clc') == 'system' - prog_mesa_clc = find_program('mesa_clc', native : true) -else +if get_option('mesa-clc') != 'system' and (with_gallium_asahi or \ + with_asahi_vk or \ + with_intel_vk or \ + with_gallium_iris or \ + get_option('install-mesa-clc')) prog_mesa_clc = executable( 'mesa_clc', ['mesa_clc.c'], diff --git a/src/compiler/spirv/meson.build b/src/compiler/spirv/meson.build index bfbfc072aa0..80531bff1f7 100644 --- a/src/compiler/spirv/meson.build +++ b/src/compiler/spirv/meson.build @@ -77,14 +77,11 @@ spirv2nir = executable( install : with_tools.contains('nir'), ) -if get_option('mesa-clc') == 'system' - prog_vtn_bindgen = find_program('vtn_bindgen', native : true) -# Due to the cross build issues in current meson, we only build vtn_bindgen when -# building drivers that need it or mesa-clc is explictly required. -# -# XXX: Build by default once https://github.com/mesonbuild/meson/pull/12022 -# ships. -elif get_option('mesa-clc') != 'auto' or with_gallium_asahi or with_asahi_vk or with_intel_vk or with_gallium_iris +if get_option('mesa-clc') != 'system' and (with_gallium_asahi or \ + with_asahi_vk or \ + with_intel_vk or \ + with_gallium_iris or \ + get_option('install-mesa-clc')) prog_vtn_bindgen = executable( 'vtn_bindgen', ['vtn_bindgen.c'], diff --git a/src/intel/compiler/meson.build b/src/intel/compiler/meson.build index 50b95b724ea..470d228a059 100644 --- a/src/intel/compiler/meson.build +++ b/src/intel/compiler/meson.build @@ -167,34 +167,38 @@ idep_intel_compiler_brw = declare_dependency( ) # For now this tool is only going to be used by Anv -if get_option('intel-clc') == 'system' or get_option('precomp-compiler') == 'system' - prog_intel_clc = find_program('intel_clc', native : true) - dep_prog_intel_clc = [] -elif with_intel_clc - prog_intel_clc = executable( - 'intel_clc', - [ - 'intel_clc.c', - 'brw_kernel.c', +if with_intel_bvh_grl + if get_option('intel-clc') == 'system' or get_option('precomp-compiler') == 'system' + prog_intel_clc = find_program('intel_clc', native : true) + dep_prog_intel_clc = [] + elif with_intel_clc + prog_intel_clc = executable( + 'intel_clc', + [ + 'intel_clc.c', + 'brw_kernel.c', - # Use just the nir_options part of ELK instead of fully linking. - 'elk/elk_nir_options.h', - 'elk/elk_nir_options.c', - 'elk/elk_spirv.c', - ], - link_with : [libisl], - include_directories : [inc_include, inc_src, inc_intel], - c_args : [pre_args, no_override_init_args], - link_args : [ld_args_build_id], - dependencies : [idep_nir, idep_mesaclc, idep_mesautil, idep_intel_dev, - idep_intel_compiler_brw], - # If we can run host binaries directly, just build intel_clc for the host. - # Most commonly this happens when doing a cross compile from an x86_64 build - # machine to an x86 host - native : not meson.can_run_host_binaries(), - install : get_option('install-intel-clc') or get_option('install-precomp-compiler'), - ) - dep_prog_intel_clc = [prog_intel_clc] + # Use just the nir_options part of ELK instead of fully linking. + 'elk/elk_nir_options.h', + 'elk/elk_nir_options.c', + 'elk/elk_spirv.c', + ], + link_with : [libisl], + include_directories : [inc_include, inc_src, inc_intel], + c_args : [pre_args, no_override_init_args], + link_args : [ld_args_build_id], + dependencies : [idep_nir, idep_mesaclc, idep_mesautil, idep_intel_dev, + idep_intel_compiler_brw], + # If we can run host binaries directly, just build intel_clc for the host. + # Most commonly this happens when doing a cross compile from an x86_64 build + # machine to an x86 host + native : not meson.can_run_host_binaries(), + install : get_option('install-intel-clc') or get_option('install-precomp-compiler'), + ) + dep_prog_intel_clc = [prog_intel_clc] + endif +else + dep_prog_intel_clc = [] endif if with_tests