diff options
author | Dave Airlie <airlied@redhat.com> | 2017-01-19 14:54:18 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-01-31 09:29:55 +1000 |
commit | 23999a363b5ef550635f6589325b2a502bdfca0a (patch) | |
tree | 06f1a142d475b570ca8c716e8988a301697d0c98 /src/amd/common | |
parent | 63fa6c6eb4c5d2effc961bbac23674c8e40660f9 (diff) |
radv/ac: handle invocation and primitive id intrinsics
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 340681fa714..bf42ed67db8 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3083,6 +3083,15 @@ static void visit_intrinsic(struct nir_to_llvm_context *ctx, case nir_intrinsic_load_base_instance: result = ctx->start_instance; break; + case nir_intrinsic_load_invocation_id: + result = ctx->gs_invocation_id; + break; + case nir_intrinsic_load_primitive_id: + if (ctx->stage == MESA_SHADER_GEOMETRY) + result = ctx->gs_prim_id; + else + fprintf(stderr, "Unknown primitive id intrinsic: %d", ctx->stage); + break; case nir_intrinsic_load_sample_id: ctx->shader_info->fs.force_persample = true; result = unpack_param(ctx, ctx->ancillary, 8, 4); |