Mesa (main): radv: only init the TC-compat ZRANGE metadata for the depth aspect
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jul 15 07:38:04 UTC 2021
Module: Mesa
Branch: main
Commit: 1ea156f44c7ce8d6880217ef4d46692cc7ac0219
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ea156f44c7ce8d6880217ef4d46692cc7ac0219
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Wed Jul 14 20:05:54 2021 +0200
radv: only init the TC-compat ZRANGE metadata for the depth aspect
With separate depth/stencil layouts, if the depth aspect is first
initialized and then cleared, the ZRANGE_PRECISION metadata might
be different than 0. Initializing it again for the stencil aspect
will overwrite the value.
Fixes rendering glitches with Scarlet Nexus on GFX8-9.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5052
Cc: 21.1 21.2 mesa-stable
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/11883>
---
src/amd/vulkan/radv_cmd_buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 84ce6131446..56308a4dca7 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -6621,7 +6621,7 @@ radv_initialize_htile(struct radv_cmd_buffer *cmd_buffer, struct radv_image *ima
radv_set_ds_clear_metadata(cmd_buffer, image, range, value, aspects);
- if (radv_image_is_tc_compat_htile(image)) {
+ if (radv_image_is_tc_compat_htile(image) && (range->aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT)) {
/* Initialize the TC-compat metada value to 0 because by
* default DB_Z_INFO.RANGE_PRECISION is set to 1, and we only
* need have to conditionally update its value when performing
More information about the mesa-commit
mailing list