tu: Reset has_tess after renderpass
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 3 Aug 2020 09:13:56 +0000 (11:13 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Tue, 4 Aug 2020 13:37:51 +0000 (15:37 +0200)
Don't force sysmem for render passes after the one that uses
tessellation.

Also, move this into tu_cmd_state as that's where it belongs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6009>

src/freedreno/vulkan/tu_cmd_buffer.c
src/freedreno/vulkan/tu_private.h

index 03130750d329efd60ffd0e3ce4601164cac16266..24b0de0085a8dcb3e97f4b395fe386e947096a48 100644 (file)
@@ -595,7 +595,7 @@ use_sysmem_rendering(struct tu_cmd_buffer *cmd)
        cmd->state.render_area.extent.height == 0)
       return true;
 
-   if (cmd->has_tess)
+   if (cmd->state.has_tess)
       return true;
 
    return false;
@@ -2529,8 +2529,8 @@ tu_CmdExecuteCommands(VkCommandBuffer commandBuffer,
             break;
          }
 
-         if (secondary->has_tess)
-            cmd->has_tess = true;
+         if (secondary->state.has_tess)
+            cmd->state.has_tess = true;
       } else {
          assert(tu_cs_is_empty(&secondary->draw_cs));
          assert(tu_cs_is_empty(&secondary->draw_epilogue_cs));
@@ -3037,7 +3037,7 @@ tu6_draw_common(struct tu_cmd_buffer *cmd,
    if (has_tess) {
       uint64_t tess_factor_iova = 0;
 
-      cmd->has_tess = true;
+      cmd->state.has_tess = true;
       result = tu6_emit_tess_consts(cmd, draw_count, pipeline, &tess_consts, &tess_factor_iova);
       if (result != VK_SUCCESS)
          return result;
@@ -3670,6 +3670,7 @@ tu_CmdEndRenderPass(VkCommandBuffer commandBuffer)
    cmd_buffer->state.pass = NULL;
    cmd_buffer->state.subpass = NULL;
    cmd_buffer->state.framebuffer = NULL;
+   cmd_buffer->state.has_tess = false;
 }
 
 void
index 9bccc20b7430ec08d1d07910904d288a217bfb8d..b5f76e7319d309491aedbabc074f319aa88ec0a9 100644 (file)
@@ -922,6 +922,7 @@ struct tu_cmd_state
    struct tu_cs_entry tile_store_ib;
 
    bool xfb_used;
+   bool has_tess;
 };
 
 struct tu_cmd_pool
@@ -1007,8 +1008,6 @@ struct tu_cmd_buffer
    struct tu_cs draw_epilogue_cs;
    struct tu_cs sub_cs;
 
-   bool has_tess;
-
    uint32_t vsc_draw_strm_pitch;
    uint32_t vsc_prim_strm_pitch;
 };