From 005d8a870c8265fa926868f1ef8bc34a19daf262 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 (cherry picked from commit 4235c39a9a8378f1e2dc0899dd4c3c941f27b887) Part-of: --- .pick_status.json | 2 +- meson.build | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f0a19666af5..f90aa42cc6c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3334,7 +3334,7 @@ "description": "meson: Let -Ddraw-use-llvm=false work for R300 on non-x86", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b8b38d38b1c14b60de0324ac2f98ff7f1f4cc3c5", "notes": null diff --git a/meson.build b/meson.build index c3a8c4d2d54..7cb55d65b8d 100644 --- a/meson.build +++ b/meson.build @@ -218,10 +218,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') @@ -1744,7 +1745,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 @@ -1788,8 +1788,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'