diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2021-07-14 20:05:54 +0200 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2021-07-22 23:05:39 +0100 |
commit | 2afdee0cdb91de9925a8b83df88bc187b1b6fefa (patch) | |
tree | 86a1c6933090759242e46156aece7f26abb42780 /src/amd | |
parent | 53d04c4f8b0646f2103be2175c8322a00f030c55 (diff) |
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@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11883>
(cherry picked from commit 1ea156f44c7ce8d6880217ef4d46692cc7ac0219)
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 7ad9fd625a0..82e6fb44940 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -5956,7 +5956,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 |