diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp index e83b6e7e2fd..8e8e364098f 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp +++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp @@ -3290,6 +3290,10 @@ static void si_update_streamout_state(struct si_context *sctx) sctx->streamout.enabled_stream_buffers_mask = shader_with_so->info.enabled_streamout_buffer_mask; sctx->streamout.stride_in_dw = shader_with_so->info.base.xfb_stride; + + /* GDS must be allocated when any GDS instructions are used, otherwise it hangs. */ + if (sctx->screen->use_ngg_streamout && shader_with_so->info.enabled_streamout_buffer_mask) + si_allocate_gds(sctx); } static void si_update_clip_regs(struct si_context *sctx, struct si_shader_selector *old_hw_vs, diff --git a/src/gallium/drivers/radeonsi/si_state_streamout.c b/src/gallium/drivers/radeonsi/si_state_streamout.c index e10174f3259..52cb4eccc1f 100644 --- a/src/gallium/drivers/radeonsi/si_state_streamout.c +++ b/src/gallium/drivers/radeonsi/si_state_streamout.c @@ -130,9 +130,6 @@ static void si_set_streamout_targets(struct pipe_context *ctx, unsigned num_targ * start writing to the targets. */ if (num_targets) { - if (sctx->screen->use_ngg_streamout) - si_allocate_gds(sctx); - sctx->flags |= SI_CONTEXT_PS_PARTIAL_FLUSH | SI_CONTEXT_CS_PARTIAL_FLUSH | SI_CONTEXT_PFP_SYNC_ME; }