summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_intrinsics.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-09-23 15:40:33 -0700
committerKenneth Graunke <[email protected]>2015-09-29 14:19:32 -0700
commit476e6d732f76f1ac1c4560ccade7cbc93f985d09 (patch)
treea76ae08caf7e20d4bbce5896eb7fa9dbfe768afe /src/glsl/nir/nir_intrinsics.h
parentcb758b892a7e62ff1f6187f2ca9ac543ff70a096 (diff)
nir: Use a system value for gl_PrimitiveIDIn.
At least on Intel hardware, gl_PrimitiveIDIn comes in as a special part of the payload rather than a normal input. This is typically what we use system values for. Dave and Ilia also agree that a system value would be nicer. At some point, we should change it at the GLSL IR level as well. But that requires changing most of the drivers. For now, let's at least make NIR do the right thing, which is easy. v2: Add a comment about not creating a temporary (suggested by Iago). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_intrinsics.h')
-rw-r--r--src/glsl/nir/nir_intrinsics.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h
index 649312fec51..ac4c2ba0eb2 100644
--- a/src/glsl/nir/nir_intrinsics.h
+++ b/src/glsl/nir/nir_intrinsics.h
@@ -194,6 +194,7 @@ SYSTEM_VALUE(instance_id, 1, 0)
SYSTEM_VALUE(sample_id, 1, 0)
SYSTEM_VALUE(sample_pos, 2, 0)
SYSTEM_VALUE(sample_mask_in, 1, 0)
+SYSTEM_VALUE(primitive_id, 1, 0)
SYSTEM_VALUE(invocation_id, 1, 0)
SYSTEM_VALUE(local_invocation_id, 3, 0)
SYSTEM_VALUE(work_group_id, 3, 0)