radv: clear the dirty flags in the corresponding emit helpers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 19 Oct 2017 10:35:45 +0000 (12:35 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 20 Oct 2017 08:39:28 +0000 (10:39 +0200)
This will allow us to fix the VGT_INDEX_TYPE issue properly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 5c0f639a9552a22cbe78b89e43884b2d28bb8292..9500e3ccb97a65dd15171a887dc271302c234977 100644 (file)
@@ -1021,6 +1021,8 @@ radv_emit_graphics_pipeline(struct radv_cmd_buffer *cmd_buffer)
        radv_save_pipeline(cmd_buffer, pipeline, RING_GFX);
 
        cmd_buffer->state.emitted_pipeline = pipeline;
+
+       cmd_buffer->state.dirty &= ~RADV_CMD_DIRTY_PIPELINE;
 }
 
 static void
@@ -1440,6 +1442,8 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer)
                radeon_emit(cmd_buffer->cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
                radeon_emit(cmd_buffer->cs, EVENT_TYPE(V_028A90_BREAK_BATCH) | EVENT_INDEX(0));
        }
+
+       cmd_buffer->state.dirty &= ~RADV_CMD_DIRTY_FRAMEBUFFER;
 }
 
 static void
@@ -1461,6 +1465,8 @@ radv_emit_index_buffer(struct radv_cmd_buffer *cmd_buffer)
 
        radeon_emit(cs, PKT3(PKT3_INDEX_BUFFER_SIZE, 0, 0));
        radeon_emit(cs, cmd_buffer->state.max_index_count);
+
+       cmd_buffer->state.dirty &= ~RADV_CMD_DIRTY_INDEX_BUFFER;
 }
 
 void radv_set_db_count_control(struct radv_cmd_buffer *cmd_buffer)
@@ -1519,6 +1525,8 @@ radv_cmd_buffer_flush_dynamic_state(struct radv_cmd_buffer *cmd_buffer)
        if (cmd_buffer->state.dirty & (RADV_CMD_DIRTY_PIPELINE |
                                       RADV_CMD_DIRTY_DYNAMIC_DEPTH_BIAS))
                radv_emit_depth_biais(cmd_buffer);
+
+       cmd_buffer->state.dirty &= ~RADV_CMD_DIRTY_DYNAMIC_ALL;
 }
 
 static void
@@ -1829,8 +1837,6 @@ radv_cmd_buffer_flush_state(struct radv_cmd_buffer *cmd_buffer,
        assert(cmd_buffer->cs->cdw <= cdw_max);
 
        si_emit_cache_flush(cmd_buffer);
-
-       cmd_buffer->state.dirty = 0;
 }
 
 static void radv_stage_flush(struct radv_cmd_buffer *cmd_buffer,