radv: fix RADV_DEBUG=syncshaders on GFX9
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 25 Jan 2018 14:46:51 +0000 (15:46 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 26 Jan 2018 11:14:27 +0000 (12:14 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index ba5fd92f2a16d47e6a1ffb5034d8ef18cfa7dea9..b694174de684bc4191ee1097228c69dd87b43fa8 100644 (file)
@@ -433,13 +433,22 @@ radv_cmd_buffer_after_draw(struct radv_cmd_buffer *cmd_buffer,
                           enum radv_cmd_flush_bits flags)
 {
        if (cmd_buffer->device->instance->debug_flags & RADV_DEBUG_SYNC_SHADERS) {
+               uint32_t *ptr = NULL;
+               uint64_t va = 0;
+
                assert(flags & (RADV_CMD_FLAG_PS_PARTIAL_FLUSH |
                                RADV_CMD_FLAG_CS_PARTIAL_FLUSH));
 
+               if (cmd_buffer->device->physical_device->rad_info.chip_class == GFX9) {
+                       va = radv_buffer_get_va(cmd_buffer->gfx9_fence_bo) +
+                            cmd_buffer->gfx9_fence_offset;
+                       ptr = &cmd_buffer->gfx9_fence_idx;
+               }
+
                /* Force wait for graphics or compute engines to be idle. */
                si_cs_emit_cache_flush(cmd_buffer->cs, false,
                                       cmd_buffer->device->physical_device->rad_info.chip_class,
-                                      NULL, 0,
+                                      ptr, va,
                                       radv_cmd_buffer_uses_mec(cmd_buffer),
                                       flags);
        }