From dab229ef69656179e1786eb097705c8d5505ade9 Mon Sep 17 00:00:00 2001 From: Sagar Ghuge Date: Sat, 23 Jan 2021 17:21:17 -0800 Subject: [PATCH] anv: Invalidate the correct AUX-TT entry While invalidating the AUX-TT entries, we have to consider the surface offset as well otherwise, we will end up invalidating another surface's CCS portion. For eg. when we have HiZ+CCS and STC_CCS enabled, both will use the CCS portion allocated at the end of BO. While invalidating the CCS portion of stencil buffer, we will end up invalidating the CCS portion that belongs to the depth main surface and vice-versa, if the surface offset is not considered. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4123 Signed-off-by: Sagar Ghuge Acked-by: Nanley Chery Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 42159ad6330..cd29db27edc 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -462,8 +462,10 @@ anv_image_init_aux_tt(struct anv_cmd_buffer *cmd_buffer, { uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect); + const struct anv_surface *surface = &image->planes[plane].surface; uint64_t base_address = - anv_address_physical(image->planes[plane].address); + anv_address_physical(anv_address_add(image->planes[plane].address, + surface->offset)); const struct isl_surf *isl_surf = &image->planes[plane].surface.isl; uint64_t format_bits = gen_aux_map_format_bits_for_isl_surf(isl_surf);