aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-01-19 10:04:26 +1100
committerTimothy Arceri <[email protected]>2018-01-23 09:23:26 +1100
commit271067967ae24d0fc6deb96821824b2fc19cf2c8 (patch)
treef4773752c17c3e98a2168d322c328817af7f029f /src/amd
parent3bc5fa69f5c8061ba9eaf30972eb21ace6593dc9 (diff)
ac: add support for gl_HelperInvocation
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 1e592db57a8..b90c31320c0 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3916,6 +3916,17 @@ static void emit_discard(struct ac_nir_context *ctx,
}
static LLVMValueRef
+visit_load_helper_invocation(struct ac_nir_context *ctx)
+{
+ LLVMValueRef result = ac_build_intrinsic(&ctx->ac,
+ "llvm.amdgcn.ps.live",
+ ctx->ac.i1, NULL, 0,
+ AC_FUNC_ATTR_READNONE);
+ result = LLVMBuildNot(ctx->ac.builder, result, "");
+ return LLVMBuildSExt(ctx->ac.builder, result, ctx->ac.i32, "");
+}
+
+static LLVMValueRef
visit_load_local_invocation_index(struct nir_to_llvm_context *ctx)
{
LLVMValueRef result;
@@ -4354,6 +4365,9 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
case nir_intrinsic_load_front_face:
result = ctx->abi->front_face;
break;
+ case nir_intrinsic_load_helper_invocation:
+ result = visit_load_helper_invocation(ctx);
+ break;
case nir_intrinsic_load_instance_id:
result = ctx->abi->instance_id;
break;