From 28e1b02a6f12e7a74b4f6970d226f8c9c01515a5 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 30 Jun 2021 17:32:25 +0200 Subject: [PATCH] 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 Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_device.c | 4 ++++ src/util/00-mesa-defaults.conf | 10 +++++++++- src/util/driconf.h | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index c1464c264d8..16bbb10f125 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -859,6 +859,7 @@ static const driOptionDescription radv_dri_options[] = { DRI_CONF_RADV_LOWER_DISCARD_TO_DEMOTE(false) DRI_CONF_RADV_INVARIANT_GEOM(false) DRI_CONF_RADV_DISABLE_TC_COMPAT_HTILE_GENERAL(false) + DRI_CONF_RADV_DISABLE_DCC(false) DRI_CONF_SECTION_END }; // clang-format on @@ -895,6 +896,9 @@ radv_init_dri_options(struct radv_instance *instance) if (driQueryOptionb(&instance->dri_options, "radv_invariant_geom")) instance->debug_flags |= RADV_DEBUG_INVARIANT_GEOM; + + if (driQueryOptionb(&instance->dri_options, "radv_disable_dcc")) + instance->debug_flags |= RADV_DEBUG_NO_DCC; } VkResult diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index ec76b2a5d51..417fe43ebea 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -829,6 +829,14 @@ TODO: document the other workarounds. + + + + + + + diff --git a/src/util/driconf.h b/src/util/driconf.h index 1c2515e2964..44e1d5bdd8b 100644 --- a/src/util/driconf.h +++ b/src/util/driconf.h @@ -509,4 +509,8 @@ DRI_CONF_OPT_B(radv_disable_tc_compat_htile_general, def, \ "Disable TC-compat HTILE in GENERAL layout") +#define DRI_CONF_RADV_DISABLE_DCC(def) \ + DRI_CONF_OPT_B(radv_disable_dcc, def, \ + "Disable DCC for color images") + #endif