radv: emit thread trace markers after every draw/dispatch call
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 18 Feb 2020 07:30:46 +0000 (08:30 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 28 Feb 2020 07:11:02 +0000 (08:11 +0100)
Thread trace markers (also called events in Radeon GPU Profiler)
should be emitted after every draw/dispatch calls to collect data.

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

src/amd/vulkan/radv_cmd_buffer.c

index b4fe37824b1297406d465d55aff862846eb7c44a..08c7400e820e3332977652c74796183b8cae8896 100644 (file)
@@ -531,6 +531,11 @@ static void
 radv_cmd_buffer_after_draw(struct radv_cmd_buffer *cmd_buffer,
                           enum radv_cmd_flush_bits flags)
 {
+       if (unlikely(cmd_buffer->device->thread_trace_bo)) {
+               radeon_emit(cmd_buffer->cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
+               radeon_emit(cmd_buffer->cs, EVENT_TYPE(V_028A90_THREAD_TRACE_MARKER) | EVENT_INDEX(0));
+       }
+
        if (cmd_buffer->device->instance->debug_flags & RADV_DEBUG_SYNC_SHADERS) {
                assert(flags & (RADV_CMD_FLAG_PS_PARTIAL_FLUSH |
                                RADV_CMD_FLAG_CS_PARTIAL_FLUSH));