New commits:
commit 7a690136e20f5d45b6bbe1721387bbdaa80ff2b4
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
graphics-libs/mesa: refactor and fix CONFIGURE
The use of 'auto' for driver options is problematic because the build
system
will select drivers, but we have no way to know what it will select, and
thus no way to determine later queries that depend on which drivers are
enabled. Such instances of 'auto' were therefore removed as a choice
even though they are supported in the build system.
Queries that offer 'all' are also problematic, but for a different
reason. In the query, the meaning of 'all' is restricted to the subset
of what is available based on preceding query choices. In the build
system, 'all' means literally all drivers with no restriction to the
subset. Therefore, when a user chooses 'all', we must transform the
values to the currently restricted set rather than directly passing the
value 'all' to the build system.
The handling of persistent variables was corrected to not include
newlines, and to not directly mangle query variables, but to copy their
values and then operate on those persistent copies. Additionally, the
persistent variables are guaranteed to not include newlines, as the
persistent_add function seems to interpret newlines as delineating
separate variables to persist.
-if [ -n "$MESA_GALLIUM" ] && ! list_find "$MESA_GALLIUM" none ;then
+MESA_GALLIUM="$MESA_GALLIUM_CHOICE" &&
+
+if [ -n "$MESA_GALLIUM" ] && ! list_find "$MESA_GALLIUM" none ;then
+ if list_find "$MESA_GALLIUM" all ;then
+ MESA_GALLIUM="$AVAILABLE_GALLIUM"
+ fi &&
+
config_query MESA_GALLIUM_HUD "Enable HUD block/NIC I/O HUD status
support?" n &&
local allow_xa
# XA state tracker requires one of the following gallium drivers
for driver in nouveau freedreno i915 svga ;do
- if list_find "$MESA_GALLIUM" $driver ;then
+ if check_gallium "$driver" ;then
allow_xa="y"
fi
done &&
@@ -169,21 +226,21 @@ if [ -n "$MESA_GALLIUM" ] && ! list_find
"$MESA_GALLIUM" none ;then
config_query MESA_GALLIUM_XA "Build gallium XA frontend?" n
fi &&
- if list_find "$MESA_GALLIUM" vmware ;then
- if ! list_find "$MESA_GALLIUM" svga ;then
+ if check_gallium vmware ;then
+ if ! check_gallium svga ;then
message "The vmware driver requires gallium svga; adding gallium
svga." &&
MESA_GALLIUM="$MESA_GALLIUM svga"
fi
fi &&
- if list_find "$MESA_GALLIUM" llvmpipe || list_find "$MESA_GALLIUM"
softpipe ;then
+ if check_gallium llvmpipe softpipe ;then
config_query MESA_GALLIUM_D3D9 "Build gallium Direct3D9 (nine)
frontend?" n &&
- if list_find "$MESA_DRIVERS" WSL ;then
+ if check_driver WSL ;then
config_query MESA_GALLIUM_D3D10 "Build gallium Direct3D10 (WDDM UMD)
frontend?" n
fi
fi &&
- if list_find "$MESA_GALLIUM" d3d12 ;then
+ if check_gallium d3d12 ;then
config_query MESA_GALLIUM_D3D12_PIPELINE "Build gallium with Direct3D12
graphics pipeline support?" n &&
config_query MESA_GALLIUM_D3D12_VIDEO "Build gallium with Direct3D12
video support?" n
fi &&
@@ -207,34 +264,11 @@ if [ -n "$MESA_GALLIUM" ] && ! list_find
"$MESA_GALLIUM" none ;then
config_query_multi MESA_RUSTICL_DRIVERS "Which drivers to enable with
rusticl by default?" \
auto \
asahi
- fi
-fi &&
-
-config_query_multi MESA_VULKAN "Which Vulkan drivers to build?" \
- none \
- all \
- auto \
- $(sort_list $AVAILABLE_VULKAN) \
- &&
-
-if [ -n "$MESA_VULKAN" ] && ! list_find "$MESA_VULKAN" none ;then
- config_query_multi MESA_VULKAN_LAYERS "Which Vulkan layers to build?" \
- none \
- device-select \
- intel-nullhw \
- overlay \
- screenshot \
- &&
-
- config_query MESA_XLIB_LEASE "Enable VK_EXT_acquire_xlib_display?" n
-fi &&
-
-config_query MESA_SHADER_CACHE "Support on-disk shader caching?" n &&
+ fi &&
-# EGL requires DRI, which is only enabled if gallium is enabled
-if ! list_find "$MESA_GALLIUM" none ;then
- # Walyand requires EGL support
- if list_find "$MESA_PLATFORMS" wayland || (list_find "$MESA_PLATFORMS"
auto && spell_ok wayland) ;then
+ # EGL requires DRI, which is only enabled if gallium is enabled
+ if check_platform "$MESA_PLATFORMS" wayland ;then
+ # Walyand requires EGL support
MESA_EGL=y &&
persistent_add MESA_EGL
else
@@ -243,34 +277,69 @@ if ! list_find "$MESA_GALLIUM" none ;then
if [[ "$MESA_EGL" == "y" ]] ;then
local egldefaults="drm surfaceless" &&
- if list_find "$MESA_PLATFORMS" x11 ;then
+ if check_platform x11 ;then
egldefaults="$egldefaults x11"
fi &&
- if list_find "$MESA_PLATFORMS" wayland ;then
+ if check_platform wayland ;then
egldefaults="$egldefaults wayland"
fi &&
- if list_find "$MESA_PLATFORMS" WSL ;then
+ if check_driver WSL ;then
egldefaults="$egldefaults windows"
fi &&
+ egldefaults="$(sort_list $egldefaults)"
config_query_list MESA_EGL_DEFAULT "Which window system should EGL
assume for EGL_DEFAULT_DISPLAY" \
auto \
- $(sort_list $egldefaults)
+ $egldefaults
fi
fi &&
+config_query_multi MESA_VULKAN_CHOICE "Which Vulkan drivers to build?" \
+ none \
+ all \
+ $AVAILABLE_VULKAN \
+ &&
+
+MESA_VULKAN="$MESA_VULKAN_CHOICE" &&
+
+if [ -n "$MESA_VULKAN" ] && ! list_find "$MESA_VULKAN" none ;then
+ if list_find "$MESA_VULKAN" all ;then
+ MESA_VULKAN="$AVAILABLE_VULKAN"
+ fi &&
+
+ config_query_multi MESA_VULKAN_LAYERS_CHOICE "Which Vulkan layers to
build?" \
+ none \
+ all \
+ $AVAILABLE_LAYERS \
+ &&
+
+ MESA_VULKAN_LAYERS="$MESA_VULKAN_LAYERS_CHOICE" &&
+
+ if list_find "$MESA_VULKAN_LAYERS" none ;then
+ MESA_VULKAN_LAYERS="none"
+ fi &&
+ if list_find "$MESA_VULKAN_LAYERS" all ;then
+ MESA_VULKAN_LAYERS="$AVAILABLE_LAYERS"
+ fi &&
+
+ config_query MESA_XLIB_LEASE "Enable VK_EXT_acquire_xlib_display?" n
+fi &&
+
+config_query MESA_SHADER_CACHE "Support on-disk shader caching?" n &&
+
config_query MESA_GLES1 "Support OpenGL ES 1.x?" n &&
config_query MESA_GLES23 "Support OpenGL ES 2.x and 3.x?" n &&
config_query MESA_OPENGL "Enable desktop OpenGL support?" y &&
config_query MESA_GBM "Enable generic buffer management (GBM) support?" n &&
config_query MESA_OSMESA "Build OSmesa to support off-screen rendering?" n &&
-config_query_list MESA_GLX "Which GLX build type (auto or dri recommended)?"
\
- auto \
+config_query_list MESA_GLX_CHOICE "Which GLX build type (dri recommended)?" \
disabled \
dri \
xlib \
&&
+MESA_GLX="$MESA_GLX_CHOICE"
+
if list_find "${MESA_GLX}" "disabled"; then
MESA_GLX="disabled"
else
@@ -284,12 +353,18 @@ fi &&
config_query MESA_SPIRV_DXIL "Build support for the SPIR-V to DXIL library?"
n &&
-config_query_multi MESA_TOOLS "Which tools to build?" \
+config_query_multi MESA_TOOLS_CHOICE "Which tools to build?" \
none \
all \
- $(sort_list $AVAILABLE_TOOLS) \
+ $AVAILABLE_TOOLS \
&&
+MESA_TOOLS="$MESA_TOOLS_CHOICE" &&
+
+if list_find "$MESA_TOOLS" all ;then
+ MESA_TOOLS="$AVAILABLE_TOOLS"
+fi
+
local perfetto_sources=""
if list_find "$MESA_DRIVERS" freedreno ;then
perfetto_sources="$perfetto_sources intel"
@@ -300,19 +375,20 @@ fi &&
if list_find "$MESA_DRIVERS" panfrost ;then
perfetto_sources="$perfetto_sources intel"
fi &&
+ perfetto_sources="$(sort_list $perfetto_sources)" &&
if [ -n "$perfetto_sources" ] ;then
config_query MESA_PERFETTO "Enable performance analysis with Perfetto" n &&
if [[ "$MESA_PERFETTO" == "y" ]] ;then
config_query_multi MESA_PERFETTO_SOURCES "Perfetto datasources to build"
\
auto \
- $(sort_list $perfetto_sources)
+ $perfetto_sources
fi
fi &&
config_query MESA_TEFLON "Enable TensorFlow Lite delegate" n &&
config_query MESA_GPUVIS "Enable tracing markers for gpuvis" n &&
-if list_find "$MESA_VULKAN" intel || list_find "$MESA_VULKAN" intel_hasvk
;then
+if check_vulkan intel intel_hasvk ;then
config_query MESA_INTEL_RT "Build Intel raytracing support (on supported
hardware)?" n
fi &&