anv/cmd_buffer: Split flush_state into two functions
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 9 Mar 2016 00:54:07 +0000 (16:54 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 9 Mar 2016 00:54:07 +0000 (16:54 -0800)
src/intel/vulkan/anv_genX.h
src/intel/vulkan/gen7_cmd_buffer.c
src/intel/vulkan/gen8_cmd_buffer.c

index a8b96e48be507eab0247fdc69df91800fcaf005b..f98127ba2389836c367ee1d5c5aa40cf75c127c5 100644 (file)
@@ -42,6 +42,7 @@ void genX(cmd_buffer_set_subpass)(struct anv_cmd_buffer *cmd_buffer,
 void genX(flush_pipeline_select_3d)(struct anv_cmd_buffer *cmd_buffer);
 
 void genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer);
+void genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer);
 
 void genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer);
 
index 8dce586eec7f259f9c932564d8a985a713e3dfbd..d552f1b4b8a82179d377fed226b57cd6632df4cc 100644 (file)
@@ -462,6 +462,8 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
       }
    }
 
+   cmd_buffer->state.vb_dirty &= ~vb_emit;
+
    if (cmd_buffer->state.dirty & ANV_CMD_DIRTY_PIPELINE) {
       /* If somebody compiled a pipeline after starting a command buffer the
        * scratch bo may have grown since we started this cmd buffer (and
@@ -521,6 +523,14 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
    if (cmd_buffer->state.dirty & ANV_CMD_DIRTY_DYNAMIC_SCISSOR)
       gen7_cmd_buffer_emit_scissor(cmd_buffer);
 
+   genX(cmd_buffer_flush_dynamic_state)(cmd_buffer);
+}
+
+void
+genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
+{
+   struct anv_pipeline *pipeline = cmd_buffer->state.pipeline;
+
    if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |
                                   ANV_CMD_DIRTY_RENDER_TARGETS |
                                   ANV_CMD_DIRTY_DYNAMIC_LINE_WIDTH |
@@ -622,7 +632,6 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
                      .BufferEndingAddress = { buffer->bo, buffer->offset + buffer->size });
    }
 
-   cmd_buffer->state.vb_dirty &= ~vb_emit;
    cmd_buffer->state.dirty = 0;
 }
 
index 0d27c27f5b7add10175dc16b4f0b853654ef5994..f1c82235d3ddb79073f8c929e1e7c334a84c4566 100644 (file)
@@ -279,6 +279,8 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
       }
    }
 
+   cmd_buffer->state.vb_dirty &= ~vb_emit;
+
    if (cmd_buffer->state.dirty & ANV_CMD_DIRTY_PIPELINE) {
       /* If somebody compiled a pipeline after starting a command buffer the
        * scratch bo may have grown since we started this cmd buffer (and
@@ -324,6 +326,14 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
    if (cmd_buffer->state.dirty & ANV_CMD_DIRTY_DYNAMIC_SCISSOR)
       gen7_cmd_buffer_emit_scissor(cmd_buffer);
 
+   genX(cmd_buffer_flush_dynamic_state)(cmd_buffer);
+}
+
+void
+genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
+{
+   struct anv_pipeline *pipeline = cmd_buffer->state.pipeline;
+
    if (cmd_buffer->state.dirty & (ANV_CMD_DIRTY_PIPELINE |
                                   ANV_CMD_DIRTY_DYNAMIC_LINE_WIDTH)) {
       __emit_sf_state(cmd_buffer);
@@ -452,7 +462,6 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
       );
    }
 
-   cmd_buffer->state.vb_dirty &= ~vb_emit;
    cmd_buffer->state.dirty = 0;
 }