[Mesa-dev] [PATCH] radv: fix subpass image transitions with multiviews

Bas Nieuwenhuizen basni at chromium.org
Thu Dec 20 11:18:44 UTC 2018


Is not ideal but will have to do for now

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Thu, Dec 20, 2018 at 12:01 PM Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
>
> The driver needs to decompress all image layers if a fast
> depth/color clear has been performed.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_cmd_buffer.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
> index aebf93b447f..c61310f3fc9 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -2315,6 +2315,17 @@ static void radv_handle_subpass_image_transition(struct radv_cmd_buffer *cmd_buf
>         range.baseArrayLayer = view->base_layer;
>         range.layerCount = cmd_buffer->state.framebuffer->layers;
>
> +       if (cmd_buffer->state.subpass && cmd_buffer->state.subpass->view_mask) {
> +               /* If the current subpass uses multiview, the driver might have
> +                * performed a fast color/depth clear to the whole image
> +                * (including all layers). To make sure the driver will
> +                * decompress the image correctly (if needed), we have to
> +                * account for the "real" number of layers. If the view mask is
> +                * sparse, this will decompress more layers than needed.
> +                */
> +               range.layerCount = util_last_bit(cmd_buffer->state.subpass->view_mask);
> +       }
> +
>         radv_handle_image_transition(cmd_buffer,
>                                      view->image,
>                                      cmd_buffer->state.attachments[idx].current_layout,
> --
> 2.20.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list