From 7668b594e61e78ea4419936293fd5c6d756e0400 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 14 Feb 2018 11:48:05 +0100 Subject: [PATCH] anv/blorp: multisample resolve all attachment layers We were only resolving the first. v2: - Do not require that the number of layers on dst and src are an exact match, it is okay if the dst has more layers so long as it has at least the same that we are going to resolve. - Do not always resolve array_len layers, we should resolve only from base_array_layer to array_len. v3: - v2 was assuming that array_len represented the total number of layers in the image, but it represents the number of layers starting at the base array ayer. v4: - The number of layers to resolve should be taken from the framebuffer (Nanley). Fixes new CTS tests for multisampled layered rendering: dEQP-VK.renderpass.multisample_resolve.layers_* Reviewed-by: Nanley Chery --- src/intel/vulkan/anv_blorp.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index bee51e0cdfd..efa2ced7f2b 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -1329,25 +1329,34 @@ anv_cmd_buffer_resolve_subpass(struct anv_cmd_buffer *cmd_buffer) VK_IMAGE_ASPECT_COLOR_BIT, ANV_IMAGE_LAYOUT_EXPLICIT_AUX, dst_aux_usage, &dst_surf); + + uint32_t base_src_layer = src_iview->planes[0].isl.base_array_layer; + uint32_t base_dst_layer = dst_iview->planes[0].isl.base_array_layer; + + assert(src_iview->planes[0].isl.array_len >= fb->layers); + assert(dst_iview->planes[0].isl.array_len >= fb->layers); + anv_cmd_buffer_mark_image_written(cmd_buffer, dst_iview->image, VK_IMAGE_ASPECT_COLOR_BIT, dst_surf.aux_usage, dst_iview->planes[0].isl.base_level, - dst_iview->planes[0].isl.base_array_layer, 1); + base_dst_layer, fb->layers); assert(!src_iview->image->format->can_ycbcr); assert(!dst_iview->image->format->can_ycbcr); - resolve_surface(&batch, - &src_surf, - src_iview->planes[0].isl.base_level, - src_iview->planes[0].isl.base_array_layer, - &dst_surf, - dst_iview->planes[0].isl.base_level, - dst_iview->planes[0].isl.base_array_layer, - render_area.offset.x, render_area.offset.y, - render_area.offset.x, render_area.offset.y, - render_area.extent.width, render_area.extent.height); + for (uint32_t i = 0; i < fb->layers; i++) { + resolve_surface(&batch, + &src_surf, + src_iview->planes[0].isl.base_level, + base_src_layer + i, + &dst_surf, + dst_iview->planes[0].isl.base_level, + base_dst_layer + i, + render_area.offset.x, render_area.offset.y, + render_area.offset.x, render_area.offset.y, + render_area.extent.width, render_area.extent.height); + } } blorp_batch_finish(&batch); -- 2.30.2