From 98ab2d34366a130fa68f59558b40f1ca12940343 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 3 May 2024 15:25:42 +0200 Subject: [PATCH] panvk: Make sure we don't lose clear-only operations The batch might contain just a clear operation on the color/depth/stencil attachments. We need to make sure fragment jobs are emitted in that case, which only happens if the framebuffer descriptor is != NULL. Signed-off-by: Boris Brezillon Acked-by: Erik Faye-Lund Part-of: --- src/panfrost/vulkan/panvk_vX_cmd_buffer.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c index da707afe198..6c8476c6477 100644 --- a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c +++ b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c @@ -150,11 +150,7 @@ panvk_per_arch(cmd_close_batch)(struct panvk_cmd_buffer *cmdbuf) assert(batch); - bool clear = fbinfo->zs.clear.z | fbinfo->zs.clear.s; - for (unsigned i = 0; i < fbinfo->rt_count; i++) - clear |= fbinfo->rts[i].clear; - - if (!clear && !batch->jc.first_job) { + if (!batch->fb.desc.gpu && !batch->jc.first_job) { if (util_dynarray_num_elements(&batch->event_ops, struct panvk_cmd_event_op) == 0) { /* Content-less batch, let's drop it */ @@ -2321,6 +2317,14 @@ panvk_per_arch(CmdEndRendering)(VkCommandBuffer commandBuffer) VK_FROM_HANDLE(panvk_cmd_buffer, cmdbuf, commandBuffer); if (!(cmdbuf->state.gfx.render.flags & VK_RENDERING_SUSPENDING_BIT)) { + struct pan_fb_info *fbinfo = &cmdbuf->state.gfx.render.fb.info; + bool clear = fbinfo->zs.clear.z | fbinfo->zs.clear.s; + for (unsigned i = 0; i < fbinfo->rt_count; i++) + clear |= fbinfo->rts[i].clear; + + if (clear) + panvk_per_arch(cmd_alloc_fb_desc)(cmdbuf); + panvk_per_arch(cmd_close_batch)(cmdbuf); cmdbuf->cur_batch = NULL; }