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

Author: Bas Nieuwenhuizen <[email protected]>
Date:   Sat Nov  4 00:14:55 2017 +0100

radv: Optimize calling radv_save_descriptors.

uint32_t data[MAX_SETS * 2] = {}; was getting executed before
the exit and took significant amounts of time. By having the
check outside the function, we skip the execution of the clear.

Reviewed-by: Dave Airlie <[email protected]>

---

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

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 4b608377fc..43505a3372 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -484,9 +484,6 @@ radv_save_descriptors(struct radv_cmd_buffer *cmd_buffer)
        uint32_t data[MAX_SETS * 2] = {};
        uint64_t va;
 
-       if (!device->trace_bo)
-               return;
-
        va = radv_buffer_get_va(device->trace_bo) + 24;
 
        MAYBE_UNUSED unsigned cdw_max = radeon_check_space(device->ws,
@@ -1723,7 +1720,8 @@ radv_flush_descriptors(struct radv_cmd_buffer *cmd_buffer,
        cmd_buffer->state.descriptors_dirty = 0;
        cmd_buffer->state.push_descriptors_dirty = false;
 
-       radv_save_descriptors(cmd_buffer);
+       if (cmd_buffer->device->trace_bo)
+               radv_save_descriptors(cmd_buffer);
 
        assert(cmd_buffer->cs->cdw <= cdw_max);
 }

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

Reply via email to