radv: add the trace BO to the BO list at submit time
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Feb 2020 12:19:41 +0000 (13:19 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 24 Feb 2020 11:43:53 +0000 (12:43 +0100)
Instead of adding it in every command buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3891>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3891>

src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_device.c

index 66c7d0721ba9dc58984b54c3bdfacac9b81f46ac..b4fe37824b1297406d465d55aff862846eb7c44a 100644 (file)
@@ -3433,14 +3433,8 @@ VkResult radv_BeginCommandBuffer(
                radv_cmd_buffer_set_subpass(cmd_buffer, subpass);
        }
 
-       if (unlikely(cmd_buffer->device->trace_bo)) {
-               struct radv_device *device = cmd_buffer->device;
-
-               radv_cs_add_buffer(device->ws, cmd_buffer->cs,
-                                  device->trace_bo);
-
+       if (unlikely(cmd_buffer->device->trace_bo))
                radv_cmd_buffer_trace_emit(cmd_buffer);
-       }
 
        cmd_buffer->status = RADV_CMD_BUFFER_STATUS_RECORDING;
 
index 348104a186cc513afcb2a02877ce5e1c9756f225..c9947592dd7eb6e52eaac240f4fc33a0ed64578e 100644 (file)
@@ -3899,6 +3899,9 @@ radv_get_preamble_cs(struct radv_queue *queue,
                if (gds_oa_bo)
                        radv_cs_add_buffer(queue->device->ws, cs, gds_oa_bo);
 
+               if (queue->device->trace_bo)
+                       radv_cs_add_buffer(queue->device->ws, cs, queue->device->trace_bo);
+
                if (i == 0) {
                        si_cs_emit_cache_flush(cs,
                                               queue->device->physical_device->rad_info.chip_class,