Mesa (staging/21.1): radv: disable DCC for DOOM 2016 and Wolfenstein II

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 12 23:22:30 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: 015e29534e529ac9e6acf2bece41ade48b33b9ea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=015e29534e529ac9e6acf2bece41ade48b33b9ea

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Jun 30 17:32:25 2021 +0200

radv: disable DCC for DOOM 2016 and Wolfenstein II

Both games perform two image layout transitions with the same image
in the same pipeline barrier with UNDEFINED and this re-initializes
DCC to the uncompressed state. No ideal solution sadly. Note that
both games declare all images as CONCURRENT.

This fixes rendering issues on GFX10+ because DCC for stores is
supported and this implicitly enables DCC for concurrent.

Fixes: da166f648f6 ("radv: enable DCC for concurrent images on GFX10")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4927
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4607
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11656>

---

 src/amd/vulkan/radv_device.c   |  6 +++++-
 src/util/00-mesa-defaults.conf | 10 +++++++++-
 src/util/driconf.h             |  4 ++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 52551ba4a5a..a03bd934970 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -870,6 +870,9 @@ radv_handle_per_app_options(struct radv_instance *instance, const VkApplicationI
 
    if (driQueryOptionb(&instance->dri_options, "radv_no_dynamic_bounds"))
       instance->debug_flags |= RADV_DEBUG_NO_DYNAMIC_BOUNDS;
+
+   if (driQueryOptionb(&instance->dri_options, "radv_disable_dcc"))
+      instance->debug_flags |= RADV_DEBUG_NO_DCC;
 }
 
 static const driOptionDescription radv_dri_options[] = {
@@ -878,7 +881,8 @@ static const driOptionDescription radv_dri_options[] = {
       DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false) DRI_CONF_RADV_REPORT_LLVM9_VERSION_STRING(false)
          DRI_CONF_RADV_ENABLE_MRT_OUTPUT_NAN_FIXUP(false)
             DRI_CONF_RADV_DISABLE_SHRINK_IMAGE_STORE(false) DRI_CONF_RADV_NO_DYNAMIC_BOUNDS(false)
-               DRI_CONF_RADV_ABSOLUTE_DEPTH_BIAS(false) DRI_CONF_RADV_OVERRIDE_UNIFORM_OFFSET_ALIGNMENT(0) DRI_CONF_SECTION_END
+               DRI_CONF_RADV_ABSOLUTE_DEPTH_BIAS(false) DRI_CONF_RADV_OVERRIDE_UNIFORM_OFFSET_ALIGNMENT(0)
+                  DRI_CONF_RADV_DISABLE_DCC(false) DRI_CONF_SECTION_END
 
                   DRI_CONF_SECTION_DEBUG DRI_CONF_OVERRIDE_VRAM_SIZE()
                      DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(false) DRI_CONF_SECTION_END};
diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf
index 299b487cc93..30af1b6d219 100644
--- a/src/util/00-mesa-defaults.conf
+++ b/src/util/00-mesa-defaults.conf
@@ -796,6 +796,14 @@ TODO: document the other workarounds.
 
         <application name="Monster Hunter World" application_name_match="MonsterHunterWorld.exe">
             <option name="radv_invariant_geom" value="true" />
-	</application>
+        </application>
+
+        <application name="DOOM (2016)" application_name_match="DOOM$">
+            <option name="radv_disable_dcc" value="true" />
+        </application>
+
+        <application name="Wolfenstein II" application_name_match="Wolfenstein II The New Colossus">
+            <option name="radv_disable_dcc" value="true" />
+        </application>
     </device>
 </driconf>
diff --git a/src/util/driconf.h b/src/util/driconf.h
index cab2f1b85b9..1b1cd92ac1e 100644
--- a/src/util/driconf.h
+++ b/src/util/driconf.h
@@ -490,4 +490,8 @@
    DRI_CONF_OPT_I(radv_override_uniform_offset_alignment, def, 0, 128, \
                   "Override the minUniformBufferOffsetAlignment exposed to the application. (0 = default)")
 
+#define DRI_CONF_RADV_DISABLE_DCC(def) \
+   DRI_CONF_OPT_B(radv_disable_dcc, def, \
+                  "Disable DCC for color images")
+
 #endif



More information about the mesa-commit mailing list