[Mesa-dev] [PATCH] radv: set the subpass before any initial subpass transitions

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Jun 6 01:38:55 UTC 2019


r-b

On Mon, Jun 3, 2019 at 3:45 PM Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
>
> While it is not wrong, I don't think this is the right fix, as the
> current_layout is not necessarily accurate.
>
> Will try to get something better.
>
> On Thu, May 30, 2019 at 3:10 PM Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
> >
> > This might fix initial subpass transitions when multiview is used.
> > Noticed while implementing sample locations during layout transitions.
> >
> > Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> > ---
> >  src/amd/vulkan/radv_cmd_buffer.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
> > index 7744ef48d06..abf454595f5 100644
> > --- a/src/amd/vulkan/radv_cmd_buffer.c
> > +++ b/src/amd/vulkan/radv_cmd_buffer.c
> > @@ -2658,7 +2658,7 @@ 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 (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
> > @@ -3761,6 +3761,8 @@ radv_cmd_buffer_begin_subpass(struct radv_cmd_buffer *cmd_buffer,
> >
> >         radv_subpass_barrier(cmd_buffer, &subpass->start_barrier);
> >
> > +       radv_cmd_buffer_set_subpass(cmd_buffer, subpass);
> > +
> >         for (uint32_t i = 0; i < subpass->attachment_count; ++i) {
> >                 const uint32_t a = subpass->attachments[i].attachment;
> >                 if (a == VK_ATTACHMENT_UNUSED)
> > @@ -3770,7 +3772,6 @@ radv_cmd_buffer_begin_subpass(struct radv_cmd_buffer *cmd_buffer,
> >                                                      subpass->attachments[i]);
> >         }
> >
> > -       radv_cmd_buffer_set_subpass(cmd_buffer, subpass);
> >         radv_cmd_buffer_clear_subpass(cmd_buffer);
> >
> >         assert(cmd_buffer->cs->cdw <= cdw_max);
> > --
> > 2.21.0
> >
> > _______________________________________________
> > 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