Mesa (main): panvk: Move check for fragment requirement up to the draw

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 27 13:54:44 UTC 2021


Module: Mesa
Branch: main
Commit: 7a0acc35af113f54f2e6ec93f27312822a01c363
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a0acc35af113f54f2e6ec93f27312822a01c363

Author: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Date:   Fri Jul 23 13:05:41 2021 +0200

panvk: Move check for fragment requirement up to the draw

As the panvk_cmd_alloc_fb_desc function might be called outside a draw,
without a pipeline having been bound to the command buffer.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

---

 src/panfrost/vulkan/panvk_cmd_buffer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/panfrost/vulkan/panvk_cmd_buffer.c b/src/panfrost/vulkan/panvk_cmd_buffer.c
index 3ef5f019ab3..bbbe3c4d1fc 100644
--- a/src/panfrost/vulkan/panvk_cmd_buffer.c
+++ b/src/panfrost/vulkan/panvk_cmd_buffer.c
@@ -911,9 +911,6 @@ panvk_CmdNextSubpass(VkCommandBuffer cmd, VkSubpassContents contents)
 static void
 panvk_cmd_alloc_fb_desc(struct panvk_cmd_buffer *cmdbuf)
 {
-   if (!cmdbuf->state.pipeline->fs.required)
-      return;
-
    struct panvk_batch *batch = cmdbuf->state.batch;
 
    if (batch->fb.desc.gpu)
@@ -1352,7 +1349,9 @@ panvk_CmdDraw(VkCommandBuffer commandBuffer,
       batch = cmdbuf->state.batch;
    }
 
-   panvk_cmd_alloc_fb_desc(cmdbuf);
+   if (cmdbuf->state.pipeline->fs.required)
+      panvk_cmd_alloc_fb_desc(cmdbuf);
+
    panvk_cmd_alloc_tls_desc(cmdbuf);
    panvk_cmd_prepare_ubos(cmdbuf);
    panvk_cmd_prepare_textures(cmdbuf);



More information about the mesa-commit mailing list