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 <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29443>
This commit is contained in:
Boris Brezillon
2024-05-03 15:25:42 +02:00
parent a1be9ee375
commit 98ab2d3436

View File

@@ -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;
}