radeonsi: for the tess barrier, only use emit_waitcnt on SI and LLVM 3.9+
authorMarek Olšák <marek.olsak@amd.com>
Tue, 17 Jan 2017 12:45:42 +0000 (13:45 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 17 Jan 2017 15:13:25 +0000 (16:13 +0100)
Cc: 17.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index f404273243f2bf5e336c5ad38c47a4d8c80c7b36..10f40a925e499353b7792a863bb941c2057b3760 100644 (file)
@@ -5440,10 +5440,13 @@ static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action,
        struct si_shader_context *ctx = si_shader_context(bld_base);
        struct gallivm_state *gallivm = bld_base->base.gallivm;
 
-       /* The real barrier instruction isn’t needed, because an entire patch
+       /* SI only (thanks to a hw bug workaround):
+        * The real barrier instruction isn’t needed, because an entire patch
         * always fits into a single wave.
         */
-       if (ctx->type == PIPE_SHADER_TESS_CTRL) {
+       if (HAVE_LLVM >= 0x0309 &&
+           ctx->screen->b.chip_class == SI &&
+           ctx->type == PIPE_SHADER_TESS_CTRL) {
                emit_waitcnt(ctx, LGKM_CNT & VM_CNT);
                return;
        }