From 5007e7fcf08c391f0c7646675460eadf6986d068 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: --- .pick_status.json | 6 +++--- src/amd/vulkan/radv_device.c | 6 +++++- src/util/00-mesa-defaults.conf | 10 +++++++++- src/util/driconf.h | 4 ++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index be9b6eefb3d..74172bee374 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -859,7 +859,7 @@ "description": "radv: fix applying radv_disable_dcc for DOOM 2016 again", "nominated": false, "nomination_type": null, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null }, @@ -1309,7 +1309,7 @@ "description": "radv: fix applying radv_disable_dcc for DOOM and Wolfenstein II", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "28e1b02a6f12e7a74b4f6970d226f8c9c01515a5" }, @@ -4576,7 +4576,7 @@ "description": "radv: disable DCC for DOOM 2016 and Wolfenstein II", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "da166f648f61e7f628e20697936667cd9879d074" }, 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. + + + + + + + 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