radeonsi/gfx10: fix legacy GS
authorMarek Olšák <marek.olsak@amd.com>
Tue, 25 Jun 2019 21:57:48 +0000 (17:57 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jul 2019 19:51:13 +0000 (15:51 -0400)
LLVM doesn't insert s_waitcnt_vscnt before GS_DONE.

There was also the crash in legacy GS copy shader.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_shader.c

index 6bdddb134602bf1f50e30b2b3850f248931cdcd3..b2f4d93bd9ff75b94c7bc8a0f6635575f9f0b2b0 100644 (file)
@@ -3603,6 +3603,9 @@ static void emit_gs_epilogue(struct si_shader_context *ctx)
                return;
        }
 
+       if (ctx->screen->info.chip_class >= GFX10)
+               LLVMBuildFence(ctx->ac.builder, LLVMAtomicOrderingRelease, false, "");
+
        ac_build_sendmsg(&ctx->ac, AC_SENDMSG_GS_OP_NOP | AC_SENDMSG_GS_DONE,
                         si_get_gs_wave_id(ctx));
 
@@ -5730,7 +5733,7 @@ si_generate_gs_copy_shader(struct si_screen *sscreen,
        /* Fetch the vertex stream ID.*/
        LLVMValueRef stream_id;
 
-       if (gs_selector->so.num_outputs)
+       if (ctx.ac.chip_class <= GFX9 && gs_selector->so.num_outputs)
                stream_id = si_unpack_param(&ctx, ctx.param_streamout_config, 24, 2);
        else
                stream_id = ctx.i32_0;