[Mesa-dev] [PATCH 19/31] radv/ac: handle invocation and primitive id intrinsics
Dave Airlie
airlied at gmail.com
Fri Jan 20 03:03:15 UTC 2017
From: Dave Airlie <airlied at redhat.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/amd/common/ac_nir_to_llvm.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 3336a3d..21eeff0 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3068,6 +3068,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);
--
2.9.3
More information about the mesa-dev
mailing list