From: Jordan Justen Date: Fri, 13 Mar 2015 18:37:03 +0000 (-0700) Subject: nir: Add gl_WorkGroupID system variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f178f0d8b7b4c410a1ac5532a26dfa51d3a72f1;p=mesa.git nir: Add gl_WorkGroupID system variable Signed-off-by: Jordan Justen Reviewed-by: Kristian Høgsberg --- diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 1774e1c13f4..96cf94c11d5 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1459,6 +1459,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin) return SYSTEM_VALUE_SAMPLE_MASK_IN; case nir_intrinsic_load_local_invocation_id: return SYSTEM_VALUE_LOCAL_INVOCATION_ID; + case nir_intrinsic_load_work_group_id: + return SYSTEM_VALUE_WORK_GROUP_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 83966129462..b981df1a71b 100644 --- a/src/glsl/nir/nir_intrinsics.h +++ b/src/glsl/nir/nir_intrinsics.h @@ -142,6 +142,7 @@ SYSTEM_VALUE(sample_pos, 2) SYSTEM_VALUE(sample_mask_in, 1) SYSTEM_VALUE(invocation_id, 1) SYSTEM_VALUE(local_invocation_id, 3) +SYSTEM_VALUE(work_group_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 91228e367a4..a656b27a72a 100644 --- a/src/glsl/nir/nir_lower_system_values.c +++ b/src/glsl/nir/nir_lower_system_values.c @@ -73,6 +73,9 @@ convert_instr(nir_intrinsic_instr *instr) case SYSTEM_VALUE_LOCAL_INVOCATION_ID: op = nir_intrinsic_load_local_invocation_id; break; + case SYSTEM_VALUE_WORK_GROUP_ID: + op = nir_intrinsic_load_work_group_id; + break; default: unreachable("not reached"); }