From dd7fdb4dee079e7b3d8f1567c5d6576dc2170ab1 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Thu, 7 Sep 2023 10:33:20 +0200 Subject: mesa: add intel raytracing support to opencl build Recently mesa added a patch that allows to cross-compile Intel Vulkan ray tracing support. - Backport this patch - Build and install intel_clc for mesa-native - Add a dependency on mesa-native to provide intel_clc for target build - Add a dependency on python3-ply-native as needed to build intel-clc - Automatically build Intel Vulkan ray tracing support if the opencl packageconfig was added (From OE-Core rev: 25fbe4d1dcfa329f0229eb3ed384b8b84583bd45) Signed-off-by: Markus Volk Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- ...tel-Allow-using-intel_clc-from-the-system.patch | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 meta/recipes-graphics/mesa/files/0001-intel-Allow-using-intel_clc-from-the-system.patch (limited to 'meta/recipes-graphics/mesa/files') diff --git a/meta/recipes-graphics/mesa/files/0001-intel-Allow-using-intel_clc-from-the-system.patch b/meta/recipes-graphics/mesa/files/0001-intel-Allow-using-intel_clc-from-the-system.patch new file mode 100644 index 0000000000..5eefd02068 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-intel-Allow-using-intel_clc-from-the-system.patch @@ -0,0 +1,99 @@ +From ac503f5d7bf36f021c576029a64ac1a3199f6b5a Mon Sep 17 00:00:00 2001 +From: Matt Turner +Date: Thu, 31 Aug 2023 13:16:29 -0400 +Subject: [PATCH] intel: Allow using intel_clc from the system + +With -Dintel-clc=system, the build system will search for an `intel_clc` +binary and use it instead of building `intel_clc` itself. + +This allows Intel Vulkan ray tracing support to be built when cross +compiling without terrible hacks (that would otherwise be necessary due +to `intel_clc`'s dependence on SPIRV-LLVM-Translator, libclc, clang, and +LLVM). + +Part-of: + +Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/28c1053c07c177854520f6283fa665f17618adb5] + +--- + meson.build | 6 +++--- + meson_options.txt | 5 ++++- + src/intel/compiler/meson.build | 6 +++++- + src/intel/vulkan/grl/meson.build | 2 +- + 4 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/meson.build b/meson.build +index 16e86ec..00a6953 100644 +--- a/meson.build ++++ b/meson.build +@@ -259,12 +259,12 @@ endif + + with_microsoft_clc = get_option('microsoft-clc').enabled() + if ['x86_64'].contains(host_machine.cpu_family()) +- with_intel_clc = get_option('intel-clc').enabled() +- with_intel_vk_rt = with_intel_vk and with_intel_clc ++ with_intel_clc = get_option('intel-clc') == 'enabled' + else + with_intel_clc = false +- with_intel_vk_rt = false + endif ++with_intel_vk_rt = with_intel_vk and get_option('intel-clc') != 'disabled' ++ + with_clc = with_microsoft_clc or with_intel_clc + with_libclc = with_clc + with_spirv_to_dxil = get_option('spirv-to-dxil') +diff --git a/meson_options.txt b/meson_options.txt +index 379aea3..9800531 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -607,9 +607,12 @@ option( + + option( + 'intel-clc', +- type : 'feature', ++ type : 'combo', + deprecated: {'true': 'enabled', 'false': 'disabled'}, + value : 'disabled', ++ choices : [ ++ 'enabled', 'disabled', 'system', ++ ], + description : 'Build the intel-clc compiler (enables Vulkan Intel ' + + 'Ray Tracing on supported hardware).' + ) +diff --git a/src/intel/compiler/meson.build b/src/intel/compiler/meson.build +index 9a03d37..774e955 100644 +--- a/src/intel/compiler/meson.build ++++ b/src/intel/compiler/meson.build +@@ -168,7 +168,10 @@ libintel_compiler = static_library( + ) + + # For now this tool is only going to be used by Anv +-if with_intel_clc ++if get_option('intel-clc') == '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'], +@@ -181,6 +184,7 @@ if with_intel_clc + dependencies : [idep_nir, idep_clc, idep_mesautil, idep_intel_dev], + native : true, + ) ++ dep_prog_intel_clc = [prog_intel_clc] + endif + + if with_tests +diff --git a/src/intel/vulkan/grl/meson.build b/src/intel/vulkan/grl/meson.build +index c0056b3..02a72f5 100644 +--- a/src/intel/vulkan/grl/meson.build ++++ b/src/intel/vulkan/grl/meson.build +@@ -143,7 +143,7 @@ foreach t : [['125', 'gfx125', 'dg2']] + # if fixed there + ], + env: ['MESA_SHADER_CACHE_DISABLE=true'], +- depends : [prog_intel_clc] ++ depends : dep_prog_intel_clc + ) + endforeach + -- cgit v1.2.3-54-g00ecf