<div dir="auto">R-b</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 21, 2019, 4:14 PM Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This simple extension might be useful for debugging purposes.<br>
GAPID has support for it.<br>
<br>
Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com" target="_blank" rel="noreferrer">samuel.pitoiset@gmail.com</a>><br>
---<br>
<br>
A simple crucible test:<br>
<a href="https://gitlab.freedesktop.org/mesa/crucible/merge_requests/47" rel="noreferrer noreferrer" target="_blank">https://gitlab.freedesktop.org/mesa/crucible/merge_requests/47</a><br>
<br>
 src/amd/vulkan/radv_cmd_buffer.c  | 35 +++++++++++++++++++++++++++++++<br>
 src/amd/vulkan/radv_extensions.py |  1 +<br>
 2 files changed, 36 insertions(+)<br>
<br>
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c<br>
index 9b4d4528028..215ccced144 100644<br>
--- a/src/amd/vulkan/radv_cmd_buffer.c<br>
+++ b/src/amd/vulkan/radv_cmd_buffer.c<br>
@@ -5716,3 +5716,38 @@ void radv_CmdDrawIndirectByteCountEXT(<br>
<br>
        radv_draw(cmd_buffer, &info);<br>
 }<br>
+<br>
+/* VK_AMD_buffer_marker */<br>
+void radv_CmdWriteBufferMarkerAMD(<br>
+    VkCommandBuffer                             commandBuffer,<br>
+    VkPipelineStageFlagBits                     pipelineStage,<br>
+    VkBuffer                                    dstBuffer,<br>
+    VkDeviceSize                                dstOffset,<br>
+    uint32_t                                    marker)<br>
+{<br>
+       RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);<br>
+       RADV_FROM_HANDLE(radv_buffer, buffer, dstBuffer);<br>
+       struct radeon_cmdbuf *cs = cmd_buffer->cs;<br>
+       uint64_t va = radv_buffer_get_va(buffer->bo) + dstOffset;<br>
+<br>
+       si_emit_cache_flush(cmd_buffer);<br>
+<br>
+       if (!(pipelineStage & ~VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT)) {<br>
+               radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));<br>
+               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_IMM) |<br>
+                               COPY_DATA_DST_SEL(COPY_DATA_DST_MEM) |<br>
+                               COPY_DATA_WR_CONFIRM);<br>
+               radeon_emit(cs, marker);<br>
+               radeon_emit(cs, 0);<br>
+               radeon_emit(cs, va);<br>
+               radeon_emit(cs, va >> 32);<br>
+       } else {<br>
+               si_cs_emit_write_event_eop(cs,<br>
+                                          cmd_buffer->device->physical_device->rad_info.chip_class,<br>
+                                          radv_cmd_buffer_uses_mec(cmd_buffer),<br>
+                                          V_028A90_BOTTOM_OF_PIPE_TS, 0,<br>
+                                          EOP_DATA_SEL_VALUE_32BIT,<br>
+                                          va, marker,<br>
+                                          cmd_buffer->gfx9_eop_bug_va);<br>
+       }<br>
+}<br>
diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py<br>
index b676cb8b8e2..1708173817b 100644<br>
--- a/src/amd/vulkan/radv_extensions.py<br>
+++ b/src/amd/vulkan/radv_extensions.py<br>
@@ -130,6 +130,7 @@ EXTENSIONS = [<br>
     Extension('VK_EXT_transform_feedback',                1, True),<br>
     Extension('VK_EXT_vertex_attribute_divisor',          3, True),<br>
     Extension('VK_EXT_ycbcr_image_arrays',                1, True),<br>
+    Extension('VK_AMD_buffer_marker',                     1, True),<br>
     Extension('VK_AMD_draw_indirect_count',               1, True),<br>
     Extension('VK_AMD_gcn_shader',                        1, True),<br>
     Extension('VK_AMD_gpu_shader_half_float',             1, 'device->rad_info.chip_class >= GFX8 && HAVE_LLVM >= 0x0800'),<br>
-- <br>
2.22.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank" rel="noreferrer">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div>