turnip: Move pipeline BO list adding to BindPipeline.
authorEric Anholt <eric@anholt.net>
Wed, 4 Dec 2019 20:22:55 +0000 (12:22 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 5 Dec 2019 04:32:15 +0000 (20:32 -0800)
We only need to do it once when we bind, rather than having to check at
every draw call.

Reviewed-by: Jonathan Marek <jonathan@marek.ca>
src/freedreno/vulkan/tu_cmd_buffer.c

index bb9d18604b8500dfb86a98e1e8cc7536d32bc067..a32495103f1682e62feae57d2b3bec3706073fb1 100644 (file)
@@ -1815,6 +1815,13 @@ tu_CmdBindPipeline(VkCommandBuffer commandBuffer,
       unreachable("unrecognized pipeline bind point");
       break;
    }
+
+   tu_bo_list_add(&cmd->bo_list, &pipeline->program.binary_bo,
+                  MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_DUMP);
+   for (uint32_t i = 0; i < pipeline->cs.bo_count; i++) {
+      tu_bo_list_add(&cmd->bo_list, pipeline->cs.bos[i],
+                     MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_DUMP);
+   }
 }
 
 void
@@ -2781,14 +2788,6 @@ tu6_bind_draw_states(struct tu_cmd_buffer *cmd,
    tu_cs_sanity_check(cs);
 
    /* track BOs */
-   if (cmd->state.dirty & TU_CMD_DIRTY_PIPELINE) {
-      tu_bo_list_add(&cmd->bo_list, &pipeline->program.binary_bo,
-                     MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_DUMP);
-      for (uint32_t i = 0; i < pipeline->cs.bo_count; i++) {
-         tu_bo_list_add(&cmd->bo_list, pipeline->cs.bos[i],
-                        MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_DUMP);
-      }
-   }
    if (cmd->state.dirty & TU_CMD_DIRTY_VERTEX_BUFFERS) {
       for (uint32_t i = 0; i < MAX_VBS; i++) {
          const struct tu_buffer *buf = cmd->state.vb.buffers[i];