Module: Mesa
Branch: master
Commit: 059d25a06de2bd396bd8d6d2dc1580361d3db915
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=059d25a06de2bd396bd8d6d2dc1580361d3db915

Author: Samuel Pitoiset <[email protected]>
Date:   Tue Nov 14 17:27:29 2017 +0100

radv: add the vertex buffers BO to the list at bind time

This should reduce the overhead of adding a BO to the current
list, especially when the list is huge. Also, when a new pipeline
is bound, we only need to update the descriptor, the buffer objects
should already be in the list.

Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>

---

 src/amd/vulkan/radv_cmd_buffer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 7e785a2334..5f025d657c 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1772,8 +1772,6 @@ radv_flush_constants(struct radv_cmd_buffer *cmd_buffer,
 static bool
 radv_cmd_buffer_update_vertex_descriptors(struct radv_cmd_buffer *cmd_buffer, 
bool pipeline_is_dirty)
 {
-       struct radv_device *device = cmd_buffer->device;
-
        if ((pipeline_is_dirty ||
            (cmd_buffer->state.dirty & RADV_CMD_DIRTY_VERTEX_BUFFER)) &&
            cmd_buffer->state.pipeline->vertex_elements.count &&
@@ -1797,7 +1795,6 @@ radv_cmd_buffer_update_vertex_descriptors(struct 
radv_cmd_buffer *cmd_buffer, bo
                        struct radv_buffer *buffer = 
cmd_buffer->vertex_bindings[vb].buffer;
                        uint32_t stride = 
cmd_buffer->state.pipeline->binding_stride[vb];
 
-                       radv_cs_add_buffer(device->ws, cmd_buffer->cs, 
buffer->bo, 8);
                        va = radv_buffer_get_va(buffer->bo);
 
                        offset = cmd_buffer->vertex_bindings[vb].offset + 
velems->offset[i];
@@ -2281,6 +2278,9 @@ void radv_CmdBindVertexBuffers(
 
                vb[idx].buffer = radv_buffer_from_handle(pBuffers[i]);
                vb[idx].offset = pOffsets[i];
+
+               radv_cs_add_buffer(cmd_buffer->device->ws, cmd_buffer->cs,
+                                  vb[idx].buffer->bo, 8);
        }
 
        if (!changed) {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to