meson: Let -Ddraw-use-llvm=false work for R300 on non-x86
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Prior to commit b8b38d38b1 ("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: b8b38d38b1 ("meson: reinstate LLVM requirement for r300 and enforce it for i915 too")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38580>
This commit is contained in:
Matt Turner 2025-11-21 11:59:29 -05:00 committed by Marge Bot
parent f0465ced7f
commit 4235c39a9a

View file

@ -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'