panvk: force_fb_preload should insert a barrier

Preloading is effectively texel fetching.  When we force preloading, we
need to insert a barrier for the feedback loop.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31895>
This commit is contained in:
Chia-I Wu 2024-10-31 12:09:55 -07:00
parent ba2c7fd00a
commit c108dfc930

View File

@ -537,6 +537,25 @@ force_fb_preload(struct panvk_cmd_buffer *cmdbuf,
}
}
/* insert a barrier for preload */
const VkMemoryBarrier2 mem_barrier = {
.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2,
.srcStageMask = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT |
VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT |
VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT,
.srcAccessMask = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT |
VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
.dstStageMask = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT,
.dstAccessMask = VK_ACCESS_2_SHADER_SAMPLED_READ_BIT,
};
const VkDependencyInfo dep_info = {
.sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO,
.memoryBarrierCount = 1,
.pMemoryBarriers = &mem_barrier,
};
panvk_per_arch(CmdPipelineBarrier2)(panvk_cmd_buffer_to_handle(cmdbuf),
&dep_info);
if (clear_att_count) {
VkClearRect clear_rect = {
.rect = render_info->renderArea,
@ -2539,10 +2558,11 @@ panvk_per_arch(cmd_flush_draws)(struct panvk_cmd_buffer *cmdbuf)
flush_tiling(cmdbuf);
issue_fragment_jobs(cmdbuf);
force_fb_preload(cmdbuf, NULL);
memset(&cmdbuf->state.gfx.render.fbds, 0,
sizeof(cmdbuf->state.gfx.render.fbds));
cmdbuf->state.gfx.render.tiler = 0;
force_fb_preload(cmdbuf, NULL);
}
VKAPI_ATTR void VKAPI_CALL