From 4235c39a9a8378f1e2dc0899dd4c3c941f27b887 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 21 Nov 2025 11:59:29 -0500 Subject: [PATCH] meson: Let -Ddraw-use-llvm=false work for R300 on non-x86 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prior to commit b8b38d38b1c ("meson: reinstate LLVM requirement for r300 and enforce it for i915 too") it was possible to build and use r300 for architectures that do not have LLVM (e.g., alpha). The only SWTCL chips are integrated graphics in x86 systems, and are not available in discrete cards. Fixes: b8b38d38b1c ("meson: reinstate LLVM requirement for r300 and enforce it for i915 too") Reviewed-by: Marek Olšák Part-of: --- meson.build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index d33becbb120..5f721858996 100644 --- a/meson.build +++ b/meson.build @@ -224,10 +224,11 @@ with_gallium_ethosu = gallium_drivers.contains('ethosu') foreach gallium_driver : gallium_drivers pre_args += '-DHAVE_@0@'.format(gallium_driver.to_upper()) endforeach +draw_with_llvm = get_option('draw-use-llvm') with_llvm = with_llvm \ .enable_if(with_gallium_i915, error_message : 'i915 Gallium driver requires LLVM for vertex shaders') \ .enable_if(with_gallium_llvmpipe, error_message : 'LLVMPipe Gallium driver requires LLVM') \ - .enable_if(with_gallium_r300, error_message : 'R300 Gallium driver requires LLVM for vertex shaders') \ + .enable_if(with_gallium_r300 and draw_with_llvm, error_message : 'R300 Gallium driver requires LLVM for vertex shaders on IGP parts') \ .enable_if(with_gallium_r600 and amd_with_llvm, error_message : 'R600 Gallium driver configured to require LLVM') \ .enable_if(with_gallium_radeonsi and amd_with_llvm, error_message : 'RadeonSI Gallium driver configured to require LLVM') @@ -1767,7 +1768,6 @@ if with_clc # but we don't know what LLVM version we are using yet llvm_optional_modules += ['all-targets', 'windowsdriver', 'frontendhlsl', 'frontenddriver'] endif -draw_with_llvm = get_option('draw-use-llvm') if draw_with_llvm llvm_modules += 'native' # lto is needded with LLVM>=15, but we don't know what LLVM verrsion we are using yet @@ -1811,8 +1811,12 @@ if dep_llvm.found() error('Lavapipe and llvmpipe require LLVM draw support.') endif - if (with_gallium_i915 or with_gallium_r300) and not draw_with_llvm - error('i915 and R300 require LLVM draw support for vertex shaders.') + if with_gallium_i915 and not draw_with_llvm + error('i915 requires LLVM draw support for vertex shaders.') + endif + + if with_gallium_r300 and not draw_with_llvm and host_machine.cpu_family() == 'x86' + error('r300 requires LLVM draw support for vertex shaders.') endif if host_machine.system() != 'windows'