[Mesa-dev] [PATCH] radv: add parameter to emit_waitcnt.
Dave Airlie
airlied at gmail.com
Mon Mar 27 22:47:37 UTC 2017
From: Dave Airlie <airlied at redhat.com>
This is just a precursor for tess support, which needs to
pass different values here.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/amd/common/ac_nir_to_llvm.c | 11 ++++++++---
1 file 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 e37d497..46e65c3 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -2851,10 +2851,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 LKGM_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);
@@ -3350,7 +3355,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);
--
2.9.3
More information about the mesa-dev
mailing list