turnip: fix sysmem CmdClearAttachments 3D fallback breaking GMEM path flush
authorJonathan Marek <jonathan@marek.ca>
Wed, 8 Jul 2020 11:46:09 +0000 (07:46 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 Aug 2020 22:38:22 +0000 (22:38 +0000)
It was clearing the flush bits, which are used by both GMEM/SYSMEM paths,
but emitting the flushes inside the cond_exec, where they would only run
for the sysmem path.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5775>

src/freedreno/vulkan/tu_clear_blit.c

index 1d25147a6cfcdd316764c737d431a14a96bb5192..7a66f106ca3704d0bd8cd1673e47c699f4cb2e03 100644 (file)
@@ -1859,9 +1859,6 @@ tu_clear_sysmem_attachments(struct tu_cmd_buffer *cmd,
       return;
    }
 
-   /* This clear path behaves like a draw, needs the same flush as tu_draw */
-   tu_emit_cache_flush_renderpass(cmd, cs);
-
    /* disable all draw states so they don't interfere
     * TODO: use and re-use draw states for this path
     * we have to disable draw states individually to preserve
@@ -2077,6 +2074,11 @@ tu_CmdClearAttachments(VkCommandBuffer commandBuffer,
    TU_FROM_HANDLE(tu_cmd_buffer, cmd, commandBuffer);
    struct tu_cs *cs = &cmd->draw_cs;
 
+   /* sysmem path behaves like a draw, note we don't have a way of using different
+    * flushes for sysmem/gmem, so this needs to be outside of the cond_exec
+    */
+   tu_emit_cache_flush_renderpass(cmd, cs);
+
    tu_cond_exec_start(cs, CP_COND_EXEC_0_RENDER_MODE_GMEM);
    tu_clear_gmem_attachments(cmd, attachmentCount, pAttachments, rectCount, pRects);
    tu_cond_exec_end(cs);