radeonsi: add a gfx10 hw bug workaround with the barrier before gs_alloc_req
authorMarek Olšák <marek.olsak@amd.com>
Thu, 13 May 2021 03:21:36 +0000 (23:21 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 25 May 2021 16:15:44 +0000 (16:15 +0000)
Fixes: 8845a23698c - amd: add NAVI10 PCI IDs

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10813>

src/gallium/drivers/radeonsi/si_shader_llvm.c

index 9ee4779..2679c64 100644 (file)
@@ -944,6 +944,10 @@ bool si_llvm_translate_nir(struct si_shader_context *ctx, struct si_shader *shad
        */
       if ((ctx->stage == MESA_SHADER_VERTEX || ctx->stage == MESA_SHADER_TESS_EVAL) &&
           shader->key.as_ngg && !shader->key.as_es && !shader->key.opt.ngg_culling) {
+         /* GFX10 requires a barrier before gs_alloc_req due to a hw bug. */
+         if (ctx->screen->info.chip_class == GFX10)
+            ac_build_s_barrier(&ctx->ac);
+
          gfx10_ngg_build_sendmsg_gs_alloc_req(ctx);
 
          /* Build the primitive export at the beginning