Merge branch 'main' into testing

This commit is contained in:
Kyle Gospodnetich 2025-01-23 16:25:37 -08:00
commit 43c4f1e889
4 changed files with 79 additions and 223 deletions

View File

@ -0,0 +1,30 @@
From d10b6aa53888f229f2b277ceeb9a945b0c7564d3 Mon Sep 17 00:00:00 2001
From: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Date: Mon, 20 Jan 2025 09:06:03 -0500
Subject: [PATCH] egl: never select swrast for vmwgfx
ForceSoftware will be true in this case from the high-level fallback,
but this isn't really swrast
Fixes: 1de7c86bc1a ("dri: pass through a type enum for creating screen instead of driver_extensions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33123>
---
src/egl/drivers/dri2/egl_dri2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index eb1e7ad080e..7fd48c8fe17 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -592,7 +592,7 @@ dri2_load_driver(_EGLDisplay *disp)
dri2_dpy->kopper = disp->Options.Zink && !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false);
dri2_dpy->kopper_without_modifiers = dri2_dpy->kopper && debug_get_bool_option("LIBGL_KOPPER_DRI2", false);
- dri2_dpy->swrast = (disp->Options.ForceSoftware && !dri2_dpy->kopper) ||
+ dri2_dpy->swrast = (disp->Options.ForceSoftware && !dri2_dpy->kopper && strcmp(dri2_dpy->driver_name, "vmwgfx")) ||
!dri2_dpy->driver_name || strstr(dri2_dpy->driver_name, "swrast");
dri2_dpy->swrast_not_kms = dri2_dpy->swrast && (!dri2_dpy->driver_name || strcmp(dri2_dpy->driver_name, "kms_swrast"));
--
2.48.1

View File

@ -1,171 +0,0 @@
From 4bf41595d70d77ec037bcf620b2cf9f3502c44ff Mon Sep 17 00:00:00 2001
From: Atapi <34801996+Sterophonick@users.noreply.github.com>
Date: Sat, 21 Dec 2024 22:13:39 -0700
Subject: [PATCH] indiana jones 2: electric boogaloo
---
src/amd/vulkan/radv_image.c | 4 ++++
src/amd/vulkan/radv_instance.c | 7 +++++++
src/amd/vulkan/radv_instance.h | 2 ++
src/amd/vulkan/radv_physical_device.c | 1 +
src/amd/vulkan/radv_physical_device.h | 1 +
src/amd/vulkan/radv_shader.c | 1 +
src/compiler/spirv/nir_spirv.h | 5 +++++
src/util/00-radv-defaults.conf | 8 ++++++++
src/util/driconf.h | 9 +++++++++
9 files changed, 38 insertions(+)
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 95afcef377d..047bd4e0d27 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -301,6 +301,10 @@ radv_use_dcc_for_image_early(struct radv_device *device, struct radv_image *imag
if (instance->drirc.disable_dcc_mips && pCreateInfo->mipLevels > 1)
return false;
+ /* Force disable DCC for stores to workaround game bugs. */
+ if (instance->drirc.disable_dcc_stores && (pCreateInfo->usage & VK_IMAGE_USAGE_STORAGE_BIT))
+ return false;
+
/* DCC MSAA can't work on GFX10.3 and earlier without FMASK. */
if (pCreateInfo->samples > 1 && pdev->info.gfx_level < GFX11 && (instance->debug_flags & RADV_DEBUG_NO_FMASK))
return false;
diff --git a/src/amd/vulkan/radv_instance.c b/src/amd/vulkan/radv_instance.c
index 2c64eda7cd8..2f034f18d6c 100644
--- a/src/amd/vulkan/radv_instance.c
+++ b/src/amd/vulkan/radv_instance.c
@@ -146,6 +146,7 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_RADV_DISABLE_TC_COMPAT_HTILE_GENERAL(false)
DRI_CONF_RADV_DISABLE_DCC(false)
DRI_CONF_RADV_DISABLE_DCC_MIPS(false)
+ DRI_CONF_RADV_DISABLE_DCC_STORES(false)
DRI_CONF_RADV_DISABLE_ANISO_SINGLE_LEVEL(false)
DRI_CONF_RADV_DISABLE_TRUNC_COORD(false)
DRI_CONF_RADV_DISABLE_SINKING_LOAD_INPUT_FS(false)
@@ -163,6 +164,7 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_RADV_OVERRIDE_COMPUTE_SHADER_VERSION(0)
DRI_CONF_RADV_OVERRIDE_RAY_TRACING_SHADER_VERSION(0)
DRI_CONF_RADV_SSBO_NON_UNIFORM(false)
+ DRI_CONF_RADV_LOWER_TERMINATE_TO_DISCARD(false)
DRI_CONF_RADV_APP_LAYER()
DRI_CONF_SECTION_END
};
@@ -261,6 +263,11 @@ radv_init_dri_options(struct radv_instance *instance)
instance->drirc.vk_require_astc = driQueryOptionb(&instance->drirc.options, "vk_require_astc");
instance->drirc.disable_dcc_mips = driQueryOptionb(&instance->drirc.options, "radv_disable_dcc_mips");
+
+ instance->drirc.disable_dcc_stores = driQueryOptionb(&instance->drirc.options, "radv_disable_dcc_stores");
+
+ instance->drirc.lower_terminate_to_discard =
+ driQueryOptionb(&instance->drirc.options, "radv_lower_terminate_to_discard");
}
static const struct vk_instance_extension_table radv_instance_extensions_supported = {
diff --git a/src/amd/vulkan/radv_instance.h b/src/amd/vulkan/radv_instance.h
index d53d67c0b24..9e7b90d12b1 100644
--- a/src/amd/vulkan/radv_instance.h
+++ b/src/amd/vulkan/radv_instance.h
@@ -69,6 +69,8 @@ struct radv_instance {
bool vk_require_etc2;
bool vk_require_astc;
bool disable_dcc_mips;
+ bool disable_dcc_stores;
+ bool lower_terminate_to_discard;
char *app_layer;
uint8_t override_graphics_shader_version;
uint8_t override_compute_shader_version;
diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c
index ae77285a19c..fb05d114599 100644
--- a/src/amd/vulkan/radv_physical_device.c
+++ b/src/amd/vulkan/radv_physical_device.c
@@ -174,6 +174,7 @@ radv_physical_device_init_cache_key(struct radv_physical_device *pdev)
key->split_fma = !!(instance->debug_flags & RADV_DEBUG_SPLIT_FMA);
key->ssbo_non_uniform = instance->drirc.ssbo_non_uniform;
key->tex_non_uniform = instance->drirc.tex_non_uniform;
+ key->lower_terminate_to_discard = instance->drirc.lower_terminate_to_discard;
key->use_llvm = pdev->use_llvm;
key->use_ngg = pdev->use_ngg;
key->use_ngg_culling = pdev->use_ngg_culling;
diff --git a/src/amd/vulkan/radv_physical_device.h b/src/amd/vulkan/radv_physical_device.h
index 469ecc3e3d0..7addcc71822 100644
--- a/src/amd/vulkan/radv_physical_device.h
+++ b/src/amd/vulkan/radv_physical_device.h
@@ -64,6 +64,7 @@ struct radv_physical_device_cache_key {
uint32_t split_fma : 1;
uint32_t ssbo_non_uniform : 1;
uint32_t tex_non_uniform : 1;
+ uint32_t lower_terminate_to_discard : 1;
uint32_t use_llvm : 1;
uint32_t use_ngg : 1;
uint32_t use_ngg_culling : 1;
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 17a1bce2590..a6711b7ab21 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -360,6 +360,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_shader_st
},
.force_tex_non_uniform = pdev->cache_key.tex_non_uniform,
.force_ssbo_non_uniform = pdev->cache_key.ssbo_non_uniform,
+ .lower_terminate_to_discard = pdev->cache_key.lower_terminate_to_discard,
};
nir = spirv_to_nir(spirv, stage->spirv.size / 4, spec_entries, num_spec_entries, stage->stage, stage->entrypoint,
&spirv_options, &pdev->nir_options[stage->stage]);
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 348a6b82c9e..d955321f53c 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -130,6 +130,11 @@ struct spirv_to_nir_options {
/* Force SSBO accesses to be non-uniform. */
bool force_ssbo_non_uniform;
+ /* Whether OpTerminateInvocation should be lowered to OpKill to workaround
+ * game bugs.
+ */
+ bool lower_terminate_to_discard;
+
/* In Debug Builds, instead of emitting an OS break on failure, just return NULL from
* spirv_to_nir(). This is useful for the unit tests that want to report a test failed
* but continue executing other tests.
diff --git a/src/util/00-radv-defaults.conf b/src/util/00-radv-defaults.conf
index 84e4d59348b..ca39a19e095 100644
--- a/src/util/00-radv-defaults.conf
+++ b/src/util/00-radv-defaults.conf
@@ -110,6 +110,14 @@ Application bugs worked around in this file:
<option name="radv_legacy_sparse_binding" value="true" />
</application>
+ <application name="Indiana Jones: The Great Circle" application_name_match="TheGreatCircle">
+ <option name="radv_zero_vram" value="true" />
+ <option name="radv_legacy_sparse_binding" value="true" />
+ <option name="radv_disable_dcc_stores" value="true" />
+ <option name="radv_invariant_geom" value="true" />
+ <option name="radv_lower_terminate_to_discard" value="true" />
+ </application>
+
<application name="DOOM (2016)" application_name_match="DOOM$">
<option name="radv_disable_dcc" value="true" />
</application>
diff --git a/src/util/driconf.h b/src/util/driconf.h
index ea325d69ea4..8352211f64e 100644
--- a/src/util/driconf.h
+++ b/src/util/driconf.h
@@ -661,6 +661,15 @@
DRI_CONF_OPT_B(radv_disable_dcc_mips, def, \
"Disable DCC for color images with mips")
+#define DRI_CONF_RADV_DISABLE_DCC_STORES(def) \
+ DRI_CONF_OPT_B(radv_disable_dcc_stores, def, \
+ "Disable DCC for color storage images")
+
+#define DRI_CONF_RADV_LOWER_TERMINATE_TO_DISCARD(def) \
+ DRI_CONF_OPT_B(radv_lower_terminate_to_discard, def, \
+ "Lower terminate to discard (which is implicitly demote)")
+
+
#define DRI_CONF_RADV_DISABLE_ANISO_SINGLE_LEVEL(def) \
DRI_CONF_OPT_B(radv_disable_aniso_single_level, def, \
"Disable anisotropic filtering for single level images")
--
2.47.1

View File

@ -65,11 +65,11 @@
%bcond_with valgrind
%endif
%global vulkan_drivers swrast%{?base_vulkan}%{?intel_platform_vulkan}%{?extra_platform_vulkan}%{?with_nvk:,nouveau}
%global vulkan_drivers swrast,virtio%{?base_vulkan}%{?intel_platform_vulkan}%{?extra_platform_vulkan}%{?with_nvk:,nouveau}
Name: mesa
Summary: Mesa graphics libraries
%global ver 24.2.8
%global ver 24.3.4
Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
Epoch: 1
%global orig_release 1%{?dist}
@ -85,14 +85,12 @@ Source1: Mesa-MLAA-License-Clarification-Email.txt
Patch10: gnome-shell-glthread-disable.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2333711
Patch11: 0001-egl-never-select-swrast-for-vmwgfx.patch
# https://gitlab.com/evlaV/mesa/
Patch20: valve.patch
# Temporary: Patches for Indiana Jones and the Great Cicle
# (Attempt 2, thx mr. pitoiset for moar fixes)
# Remove this once we get Mesa 24.3.x in upstream fedora
Patch30: indiana-2.patch
BuildRequires: meson >= 1.3.0
BuildRequires: gcc
BuildRequires: gcc-c++
@ -421,7 +419,6 @@ export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
%meson \
-Dplatforms=x11,wayland \
-Ddri3=enabled \
-Dosmesa=true \
%if 0%{?with_hardware}
-Dgallium-drivers=swrast,virgl,nouveau%{?with_r300:,r300}%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi}%{?with_r600:,r600}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink} \
@ -583,6 +580,7 @@ popd
%files dri-drivers
%{_datadir}/drirc.d/00-mesa-defaults.conf
%{_libdir}/libgallium-*.so
%{_libdir}/gbm/dri_gbm.so
%{_libdir}/dri/kms_swrast_dri.so
%{_libdir}/dri/libdril_dri.so
%{_libdir}/dri/swrast_dri.so
@ -707,6 +705,8 @@ popd
%files vulkan-drivers
%{_libdir}/libvulkan_lvp.so
%{_datadir}/vulkan/icd.d/lvp_icd.*.json
%{_libdir}/libvulkan_virtio.so
%{_datadir}/vulkan/icd.d/virtio_icd.*.json
%{_libdir}/libVkLayer_MESA_device_select.so
%{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json
%if 0%{?with_vulkan_hw}

View File

@ -1,19 +1,19 @@
From 239ea5c4cc82596383fba0342611a25d8d5a3d47 Mon Sep 17 00:00:00 2001
From 04afaf13b208f5c58c0b057f3dfc2dfa5c19a334 Mon Sep 17 00:00:00 2001
From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Date: Fri, 14 Jan 2022 15:58:45 +0100
Subject: [PATCH 1/2] STEAMOS: radv: min image count override for FH5
Subject: [PATCH 5/8] STEAMOS: radv: min image count override for FH5
Otherwise in combination with the vblank time reservation in
gamescope the game could get stuck in low power states.
---
src/util/00-radv-defaults.conf | 5 +++++
1 file changed, 5 insertions(+)
src/util/00-radv-defaults.conf | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/util/00-radv-defaults.conf b/src/util/00-radv-defaults.conf
index 983ce2511a7..3b3a6b36946 100644
index 1cbb2e087c9..43488ada6bc 100644
--- a/src/util/00-radv-defaults.conf
+++ b/src/util/00-radv-defaults.conf
@@ -200,6 +200,11 @@ Application bugs worked around in this file:
@@ -207,6 +207,11 @@ Application bugs worked around in this file:
<application name="Rocket League" executable="RocketLeague">
<option name="radv_zero_vram" value="true" />
</application>
@ -25,26 +25,26 @@ index 983ce2511a7..3b3a6b36946 100644
<application name="Crystal Project" executable="Crystal Project.bin.x86_64">
<option name="radv_zero_vram" value="true" />
</application>
--
2.45.2
2.42.0
From b9a0bf948614b64b073ad1ee145987afdeb33994 Mon Sep 17 00:00:00 2001
From b1c0d3de07bf958317f386585ce541b1c336e929 Mon Sep 17 00:00:00 2001
From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Date: Mon, 21 Feb 2022 18:43:54 +0100
Subject: [PATCH 2/2] STEAMOS: Dynamic swapchain override for gamescope limiter
Subject: [PATCH 6/8] STEAMOS: Dynamic swapchain override for gamescope limiter
---
src/loader/loader_dri3_helper.c | 42 +++++++++++++++++++++++++++++++--
src/loader/loader_dri3_helper.h | 1 +
src/gallium/frontends/dri/loader_dri3_helper.c | 42 +++++++++++++++++++++++++++++++--
src/gallium/frontends/dri/loader_dri3_helper.h | 1 +
src/loader/meson.build | 2 +-
3 files changed, 42 insertions(+), 3 deletions(-)
4 files changed, 80 insertions(+), 3 deletions(-)
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index dc1db4fa8be..38e55dc23ae 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -289,6 +289,30 @@ dri3_update_max_num_back(struct loader_dri3_drawable *draw)
diff --git a/src/gallium/frontends/dri/loader_dri3_helper.c b/src/gallium/frontends/dri/loader_dri3_helper.c
index 2631a9e2fd5..dbf6db349c6 100644
--- a/src/gallium/frontends/dri/loader_dri3_helper.c
+++ b/src/gallium/frontends/dri/loader_dri3_helper.c
@@ -276,6 +276,30 @@ dri3_update_max_num_back(struct loader_dri3_drawable *draw)
}
}
@ -75,7 +75,7 @@ index dc1db4fa8be..38e55dc23ae 100644
void
loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval)
{
@@ -303,10 +327,12 @@ loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval)
@@ -290,10 +314,12 @@ loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval)
* PS. changing from value A to B and A < B won't cause swap out of order but
* may still gets wrong target_msc value at the beginning.
*/
@ -90,9 +90,9 @@ index dc1db4fa8be..38e55dc23ae 100644
}
static void
@@ -438,6 +464,12 @@ loader_dri3_drawable_init(xcb_connection_t *conn,
draw->swap_interval = dri_get_initial_swap_interval(draw->dri_screen_render_gpu,
draw->ext->config);
@@ -422,6 +448,12 @@ loader_dri3_drawable_init(xcb_connection_t *conn,
draw->swap_interval = dri_get_initial_swap_interval(draw->dri_screen_render_gpu);
+ draw->orig_swap_interval = draw->swap_interval;
+
@ -103,7 +103,7 @@ index dc1db4fa8be..38e55dc23ae 100644
dri3_update_max_num_back(draw);
/* Create a new drawable */
@@ -1085,6 +1117,12 @@ loader_dri3_swap_buffers_msc(struct loader_dri3_drawable *draw,
@@ -1066,6 +1098,12 @@ loader_dri3_swap_buffers_msc(struct loader_dri3_drawable *draw,
if (draw->type == LOADER_DRI3_DRAWABLE_WINDOW) {
dri3_fence_reset(draw->conn, back);
@ -116,31 +116,28 @@ index dc1db4fa8be..38e55dc23ae 100644
/* Compute when we want the frame shown by taking the last known
* successful MSC and adding in a swap interval for each outstanding swap
* request. target_msc=divisor=remainder=0 means "Use glXSwapBuffers()
diff --git a/src/loader/loader_dri3_helper.h b/src/loader/loader_dri3_helper.h
diff --git a/src/gallium/frontends/dri/loader_dri3_helper.h b/src/gallium/frontends/dri/loader_dri3_helper.h
index cc2362dd599..fe73b3f329c 100644
--- a/src/loader/loader_dri3_helper.h
+++ b/src/loader/loader_dri3_helper.h
@@ -178,6 +178,7 @@ struct loader_dri3_drawable {
--- a/src/gallium/frontends/dri/loader_dri3_helper.h
+++ b/src/gallium/frontends/dri/loader_dri3_helper.h
@@ -170,6 +170,7 @@ struct loader_dri3_drawable {
bool block_on_depleted_buffers;
bool queries_buffer_age;
int swap_interval;
+ int orig_swap_interval;
struct loader_dri3_extensions *ext;
const struct loader_dri3_vtable *vtable;
diff --git a/src/loader/meson.build b/src/loader/meson.build
index ffb970f26be..326e2b5b9fd 100644
--- a/src/loader/meson.build
+++ b/src/loader/meson.build
@@ -29,7 +29,7 @@ if with_platform_x11 and with_dri3
dependencies : [
idep_mesautil,
dep_libdrm, dep_xcb_dri3, dep_xcb_present, dep_xcb_sync, dep_xshmfence,
- dep_xcb_xfixes,
+ dep_xcb_xfixes, dep_xcb_xrandr, idep_mesautil
],
build_by_default : false,
)
--
2.45.2
diff --git a/src/gallium/frontends/dri/meson.build b/src/gallium/frontends/dri/meson.build
index a98c8c0..0d4f816 100644
--- a/src/gallium/frontends/dri/meson.build
+++ b/src/gallium/frontends/dri/meson.build
@@ -23,7 +23,7 @@ if with_platform_x11
deps_for_libdri += dep_xcb
if with_dri_platform == 'drm'
deps_for_libdri += [dep_xcb_dri3, dep_xcb_present, dep_xcb_sync,
- dep_xshmfence, dep_xcb_xfixes]
+ dep_xshmfence, dep_xcb_xfixes, dep_xcb_xrandr, idep_mesautil]
files_libdri += files('loader_dri3_helper.c')
endif
endif