radv/gfx10: make GDS idle when leaving the IB
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 10 Sep 2019 08:56:24 +0000 (10:56 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 16 Sep 2019 10:08:22 +0000 (12:08 +0200)
NGG streamout uses GDS and we have to make sure that another
process isn't going to overwrite GDS while our shaders are busy.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c

index 5b736c67ae83199967bb615f1f0bedb473fa9db1..f0fdad68a94c3767e7c792544fa2fe60912327d0 100644 (file)
@@ -3615,6 +3615,13 @@ VkResult radv_EndCommandBuffer(
                 */
                cmd_buffer->state.flush_bits |= cmd_buffer->active_query_flush_bits;
 
+               /* Since NGG streamout uses GDS, we need to make GDS idle when
+                * we leave the IB, otherwise another process might overwrite
+                * it while our shaders are busy.
+                */
+               if (cmd_buffer->gds_needed)
+                       cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_PS_PARTIAL_FLUSH;
+
                si_emit_cache_flush(cmd_buffer);
        }