[Mesa-dev] [PATCH 2/3] radv: replace vb_dirty with RADV_CMD_DIRTY_VERTEX_BUFFER

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Nov 14 16:27:28 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/vulkan/radv_cmd_buffer.c | 7 ++++---
 src/amd/vulkan/radv_private.h    | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 6503c031bd..5e5e5e4d4b 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1781,7 +1781,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;
@@ -1827,7 +1828,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;
 }
@@ -2302,7 +2303,7 @@ void radv_CmdBindVertexBuffers(
 		return;
 	}
 
-	cmd_buffer->state.vb_dirty = true;
+	cmd_buffer->state.dirty |= RADV_CMD_DIRTY_VERTEX_BUFFER;
 }
 
 void radv_CmdBindIndexBuffer(
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 2de3eccf0e..5be3f47b46 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -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;
-- 
2.15.0



More information about the mesa-dev mailing list