diff options
author | Jordan Justen <[email protected]> | 2015-03-13 11:32:43 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2015-09-13 09:53:16 -0700 |
commit | 62e011d593008e61ddcba3c32b5710505f4974e6 (patch) | |
tree | 68454409616ce79ae8abec93bd89fac1a828b214 /src/glsl | |
parent | bf8d6e501c58b3d6c06056b663ec99b9c7eeb9cf (diff) |
nir: Add gl_LocalInvocationID variable
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/nir.c | 2 | ||||
-rw-r--r-- | src/glsl/nir/nir_intrinsics.h | 1 | ||||
-rw-r--r-- | src/glsl/nir/nir_lower_system_values.c | 3 |
3 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index aafcb939e3a..1774e1c13f4 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1457,6 +1457,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin) return SYSTEM_VALUE_SAMPLE_POS; case nir_intrinsic_load_sample_mask_in: return SYSTEM_VALUE_SAMPLE_MASK_IN; + case nir_intrinsic_load_local_invocation_id: + return SYSTEM_VALUE_LOCAL_INVOCATION_ID; /* FINISHME: Add tessellation intrinsics. return SYSTEM_VALUE_TESS_COORD; return SYSTEM_VALUE_VERTICES_IN; diff --git a/src/glsl/nir/nir_intrinsics.h b/src/glsl/nir/nir_intrinsics.h index 07dd5cf1ec3..83966129462 100644 --- a/src/glsl/nir/nir_intrinsics.h +++ b/src/glsl/nir/nir_intrinsics.h @@ -141,6 +141,7 @@ SYSTEM_VALUE(sample_id, 1) SYSTEM_VALUE(sample_pos, 2) SYSTEM_VALUE(sample_mask_in, 1) SYSTEM_VALUE(invocation_id, 1) +SYSTEM_VALUE(local_invocation_id, 3) /* * The format of the indices depends on the type of the load. For uniforms, diff --git a/src/glsl/nir/nir_lower_system_values.c b/src/glsl/nir/nir_lower_system_values.c index 440fb0b1b8e..91228e367a4 100644 --- a/src/glsl/nir/nir_lower_system_values.c +++ b/src/glsl/nir/nir_lower_system_values.c @@ -70,6 +70,9 @@ convert_instr(nir_intrinsic_instr *instr) case SYSTEM_VALUE_INVOCATION_ID: op = nir_intrinsic_load_invocation_id; break; + case SYSTEM_VALUE_LOCAL_INVOCATION_ID: + op = nir_intrinsic_load_local_invocation_id; + break; default: unreachable("not reached"); } |