From 52b6adfbfb51a3b1a54964cbcb2adb0299d1252b Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 7 Jan 2021 08:38:01 +0100 Subject: [PATCH] radv: disable TC-compat HTILE in GENERAL for Detroit: Become Human The game has invalid usage of render loops and enabling TC-compat HTILE in GENERAL introduces rendering issues. Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3063 Cc: mesa-stable Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_device.c | 8 ++++++++ src/amd/vulkan/radv_image.c | 3 ++- src/amd/vulkan/radv_private.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 9c4ce0172d5..6d4b83580eb 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -619,6 +619,14 @@ radv_handle_per_app_options(struct radv_instance *instance, /* Fix various artifacts in Detroit: Become Human */ instance->debug_flags |= RADV_DEBUG_ZERO_VRAM | RADV_DEBUG_DISCARD_TO_DEMOTE; + + /* Fix rendering issues in Detroit: Become Human + * because the game uses render loops (it + * samples/renders from/to the same depth/stencil + * texture inside the same draw) without input + * attachments and that is invalid Vulkan usage. + */ + instance->disable_tc_compat_htile_in_general = true; } } diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 6ecd0ac3d7a..80d1401583f 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -1841,7 +1841,8 @@ bool radv_layout_is_htile_compressed(const struct radv_device *device, */ if (radv_image_is_tc_compat_htile(image) && queue_mask & (1u << RADV_QUEUE_GENERAL) && - !in_render_loop) { + !in_render_loop && + !device->instance->disable_tc_compat_htile_in_general) { /* GFX10+ supports compressed writes to HTILE. */ return device->physical_device->rad_info.chip_class >= GFX10 || !(image->usage & VK_IMAGE_USAGE_STORAGE_BIT); diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 09dbe148621..c273eae2ba3 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -360,6 +360,7 @@ struct radv_instance { * Workarounds for game bugs. */ bool enable_mrt_output_nan_fixup; + bool disable_tc_compat_htile_in_general; }; VkResult radv_init_wsi(struct radv_physical_device *physical_device);