anv/cmd_buffer: Emit CS push constants after binding tables
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 22 Nov 2016 17:35:01 +0000 (09:35 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 22 Nov 2016 18:10:38 +0000 (10:10 -0800)
Emitting binding tables can cause push constants to be dirtied if the
shader uses images so we need to handle push constants later.

src/intel/vulkan/genX_cmd_buffer.c

index 138ce7043f9d87875717a6de41579e4eef0ec0ee..44610f89ba1ad66b781a50bfe33923d58afa0eb9 100644 (file)
@@ -1580,6 +1580,14 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
       anv_batch_emit_batch(&cmd_buffer->batch, &pipeline->batch);
    }
 
+   if ((cmd_buffer->state.descriptors_dirty & VK_SHADER_STAGE_COMPUTE_BIT) ||
+       (cmd_buffer->state.compute_dirty & ANV_CMD_DIRTY_PIPELINE)) {
+      /* FIXME: figure out descriptors for gen7 */
+      result = flush_compute_descriptor_set(cmd_buffer);
+      assert(result == VK_SUCCESS);
+      cmd_buffer->state.descriptors_dirty &= ~VK_SHADER_STAGE_COMPUTE_BIT;
+   }
+
    if (cmd_buffer->state.push_constants_dirty & VK_SHADER_STAGE_COMPUTE_BIT) {
       struct anv_state push_state =
          anv_cmd_buffer_cs_push_constants(cmd_buffer);
@@ -1592,14 +1600,6 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
       }
    }
 
-   if ((cmd_buffer->state.descriptors_dirty & VK_SHADER_STAGE_COMPUTE_BIT) ||
-       (cmd_buffer->state.compute_dirty & ANV_CMD_DIRTY_PIPELINE)) {
-      /* FIXME: figure out descriptors for gen7 */
-      result = flush_compute_descriptor_set(cmd_buffer);
-      assert(result == VK_SUCCESS);
-      cmd_buffer->state.descriptors_dirty &= ~VK_SHADER_STAGE_COMPUTE_BIT;
-   }
-
    cmd_buffer->state.compute_dirty = 0;
 
    genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);