[Mesa-dev] [PATCH v2] anv/blorp: multisample resolve all attachment layers
Iago Toral
itoral at igalia.com
Thu Feb 15 08:38:51 UTC 2018
On Thu, 2018-02-15 at 09:24 +0100, Iago Toral Quiroga wrote:
> 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.
Ignore this v2, it doesn't account for the fact that array_len
represent the number of layers starting at the base layer. I'll send a
v3 shortly.
> Fixes new CTS tests for multisampled layered rendering:
> dEQP-VK.renderpass.multisample_resolve.layers_*
> ---
> src/intel/vulkan/anv_blorp.c | 30 +++++++++++++++++++-----------
> 1 file changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_blorp.c
> b/src/intel/vulkan/anv_blorp.c
> index d38b343671..9afac89b2d 100644
> --- a/src/intel/vulkan/anv_blorp.c
> +++ b/src/intel/vulkan/anv_blorp.c
> @@ -1543,25 +1543,33 @@ anv_cmd_buffer_resolve_subpass(struct
> anv_cmd_buffer *cmd_buffer)
> get_blorp_surf_for_anv_image(cmd_buffer->device, dst_iview-
> >image,
> VK_IMAGE_ASPECT_COLOR_BIT,
> 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;
> + uint32_t num_layers = src_iview->planes[0].isl.array_len -
> base_src_layer;
> + assert(num_layers <= dst_iview->planes[0].isl.array_len -
> base_dst_layer);
> +
> 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,
> num_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 < num_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);
More information about the mesa-dev
mailing list