summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-12-02 19:10:11 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2016-12-14 19:03:12 +0000
commit2da119dfe9ce8684d56745e43fda224a0dad3465 (patch)
treee0991a076038ebea1089d7e9ebd2ca0d1fa43841
parent6f37d3067954a1ed70ea1a0bfe60783ba7b04166 (diff)
downloadexternal_mesa3d-2da119dfe9ce8684d56745e43fda224a0dad3465.zip
external_mesa3d-2da119dfe9ce8684d56745e43fda224a0dad3465.tar.gz
external_mesa3d-2da119dfe9ce8684d56745e43fda224a0dad3465.tar.bz2
radeonsi: wait for outstanding memory instructions in TCS barriers
Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 16f49c16c79a67f174b92672d546f909425f7fc3)
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 3a691f3..73887a1 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -3309,6 +3309,7 @@ static void build_tex_intrinsic(const struct lp_build_tgsi_action *action,
* point in the program by emitting empty inline assembly that is marked as
* having side effects.
*/
+#if 0 /* unused currently */
static void emit_optimization_barrier(struct si_shader_context *ctx)
{
LLVMBuilderRef builder = ctx->gallivm.builder;
@@ -3316,7 +3317,10 @@ static void emit_optimization_barrier(struct si_shader_context *ctx)
LLVMValueRef inlineasm = LLVMConstInlineAsm(ftype, "", "", true, false);
LLVMBuildCall(builder, inlineasm, NULL, 0, "");
}
+#endif
+/* Combine these with & instead of |. */
+#define LGKM_CNT 0x07f
#define VM_CNT 0xf70
static void emit_waitcnt(struct si_shader_context *ctx, unsigned simm16)
@@ -5366,7 +5370,7 @@ static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action,
* always fits into a single wave.
*/
if (ctx->type == PIPE_SHADER_TESS_CTRL) {
- emit_optimization_barrier(ctx);
+ emit_waitcnt(ctx, LGKM_CNT & VM_CNT);
return;
}