radv: replace vb_dirty with RADV_CMD_DIRTY_VERTEX_BUFFER
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 14 Nov 2017 16:27:28 +0000 (17:27 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 15 Nov 2017 08:01:05 +0000 (09:01 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_private.h

index e60df1471c9a775e0820ab32d86ba84ca3fdad56..7e785a233405f458c8f6d5aa4815acbe25972492 100644 (file)
@@ -1774,7 +1774,8 @@ radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer, bo
 {
        struct radv_device *device = cmd_buffer->device;
 
-       if ((pipeline_is_dirty || cmd_buffer->state.vb_dirty) &&
+       if ((pipeline_is_dirty ||
+           (cmd_buffer->state.dirty & RADV_CMD_DIRTY_VERTEX_BUFFER)) &&
            cmd_buffer->state.pipeline->vertex_elements.count &&
            radv_get_vertex_shader(cmd_buffer->state.pipeline)->info.info.vs.has_vertex_buffers) {
                struct radv_vertex_elements_info *velems = &cmd_buffer->state.pipeline->vertex_elements;
@@ -1820,7 +1821,7 @@ radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer, bo
                cmd_buffer->state.vb_size = count * 16;
                cmd_buffer->state.vb_prefetch_dirty = true;
        }
-       cmd_buffer->state.vb_dirty = false;
+       cmd_buffer->state.dirty &= ~RADV_CMD_DIRTY_VERTEX_BUFFER;
 
        return true;
 }
@@ -2287,7 +2288,7 @@ void radv_CmdBindVertexBuffers(
                return;
        }
 
-       cmd_buffer->state.vb_dirty = true;
+       cmd_buffer->state.dirty |= RADV_CMD_DIRTY_VERTEX_BUFFER;
 }
 
 void radv_CmdBindIndexBuffer(
index a416f38a7303c1ec4a18a3230ea4399a3935af91..93f93b98364c918cb64ec5ef74bded7611652bd4 100644 (file)
@@ -701,6 +701,7 @@ enum radv_cmd_dirty_bits {
        RADV_CMD_DIRTY_PIPELINE                          = 1 << 9,
        RADV_CMD_DIRTY_INDEX_BUFFER                      = 1 << 10,
        RADV_CMD_DIRTY_FRAMEBUFFER                       = 1 << 11,
+       RADV_CMD_DIRTY_VERTEX_BUFFER                     = 1 << 12,
 };
 
 enum radv_cmd_flush_bits {
@@ -809,7 +810,6 @@ struct radv_attachment_state {
 
 struct radv_cmd_state {
        /* Vertex descriptors */
-       bool                                          vb_dirty;
        bool                                          vb_prefetch_dirty;
        uint64_t                                      vb_va;
        unsigned                                      vb_size;