panvk/jm: Preload the FB even if we have no draws queued

There seems to be cases where we end up with a depth/stencil preload,
with no draw associated to it, so let's make sure we preload in that
case, otherwise we will write invalid data back.

Fixes: 0bc3502ca3 ("panvk: Implement a custom FB preload logic")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37158>
(cherry picked from commit 023972827a)
This commit is contained in:
Boris Brezillon 2025-09-11 09:17:24 +02:00 committed by Eric Engestrom
parent 652ce02ba0
commit 9174a02476
4 changed files with 11 additions and 7 deletions

View file

@ -4454,7 +4454,7 @@
"description": "panvk/jm: Preload the FB even if we have no draws queued",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "0bc3502ca36b7b5f244e5de34813f46ce2ff4a1b",
"notes": null

View file

@ -458,7 +458,6 @@ dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_2_secondary_cmdbuffers
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_primary_secondary_cmdbuffers_resuming,Fail
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_secondary_2_primary_cmdbuffers_resuming,Fail
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_secondary_primary_cmdbuffers_resuming,Fail
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.partial_binding_depth_stencil,Fail
dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.single_cmdbuffer_resuming,Fail
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.indexed_draw.draw_indexed_triangle_list_offset_minus_one_with_alloc_offset,Fail

View file

@ -149,11 +149,9 @@ panvk_per_arch(cmd_close_batch)(struct panvk_cmd_buffer *cmdbuf)
fbinfo->first_provoking_vertex =
cmdbuf->state.gfx.render.first_provoking_vertex != U_TRISTATE_NO;
if (batch->vtc_jc.first_tiler) {
VkResult result = panvk_per_arch(cmd_fb_preload)(cmdbuf, fbinfo);
if (result != VK_SUCCESS)
return;
}
VkResult result = panvk_per_arch(cmd_fb_preload)(cmdbuf, fbinfo);
if (result != VK_SUCCESS)
return;
uint32_t view_mask = cmdbuf->state.gfx.render.view_mask;
assert(view_mask == 0 || util_bitcount(view_mask) <= batch->fb.layer_count);

View file

@ -441,6 +441,13 @@ cmd_emit_dcd(struct panvk_cmd_buffer *cmdbuf, struct pan_fb_info *fbinfo,
struct mali_draw_packed dcd_base;
/* If we got a preload without any draw, we end up with a NULL TLS
* descriptor. Allocate a dummy one (no TLS, no WLS) to get things working. */
if (!batch->tls.cpu) {
panvk_per_arch(cmd_alloc_tls_desc)(cmdbuf, true);
GENX(pan_emit_tls)(&batch->tlsinfo, batch->tls.cpu);
}
pan_pack(&dcd_base, DRAW, cfg) {
cfg.thread_storage = batch->tls.gpu;
cfg.state = rsd.gpu;