summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-03-28 08:46:35 +1000
committerDave Airlie <[email protected]>2017-03-28 17:40:03 +1000
commitd43691ce775ed7bd525b5d195cc6e17b7c15574e (patch)
tree3b05060cbb240186a1cb2507278a588d73bd7b3b /src
parent931a8d0c9a15df462f14ab40f9ae31c8ecf75376 (diff)
radv: add parameter to emit_waitcnt.
This is just a precursor for tess support, which needs to pass different values here. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index cfbdeae1a3b..5a25487a301 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -2818,10 +2818,15 @@ static LLVMValueRef visit_image_size(struct nir_to_llvm_context *ctx,
return res;
}
-static void emit_waitcnt(struct nir_to_llvm_context *ctx)
+#define NOOP_WAITCNT 0xf7f
+#define LGKM_CNT 0x07f
+#define VM_CNT 0xf70
+
+static void emit_waitcnt(struct nir_to_llvm_context *ctx,
+ unsigned simm16)
{
LLVMValueRef args[1] = {
- LLVMConstInt(ctx->i32, 0xf70, false),
+ LLVMConstInt(ctx->i32, simm16, false),
};
ac_build_intrinsic(&ctx->ac, "llvm.amdgcn.s.waitcnt",
ctx->voidt, args, 1, 0);
@@ -3297,7 +3302,7 @@ static void visit_intrinsic(struct nir_to_llvm_context *ctx,
emit_discard_if(ctx, instr);
break;
case nir_intrinsic_memory_barrier:
- emit_waitcnt(ctx);
+ emit_waitcnt(ctx, VM_CNT);
break;
case nir_intrinsic_barrier:
emit_barrier(ctx);