[Mesa-dev] [PATCH] ac: add support for gl_HelperInvocation
Nicolai Hähnle
nhaehnle at gmail.com
Mon Jan 22 12:38:17 UTC 2018
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
On 19.01.2018 00:05, Timothy Arceri wrote:
> ---
> src/amd/common/ac_nir_to_llvm.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index cf0b3d998c..4f240db4ac 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -3914,6 +3914,17 @@ static void emit_discard(struct ac_nir_context *ctx,
> ac_build_kill_if_false(&ctx->ac, cond);
> }
>
> +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)
> {
> @@ -4316,6 +4327,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;
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list