nir: Convert SYSTEM_VALUE_NUM_WORK_GROUPS to a nir intrinsic
authorJordan Justen <jordan.l.justen@intel.com>
Sun, 23 Aug 2015 01:51:08 +0000 (18:51 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 29 Sep 2015 15:23:47 +0000 (08:23 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/glsl/nir/nir.c
src/glsl/nir/nir_intrinsics.h

index 1206bb4dfcbf27dd2a5942b8cfd337bfa3e9bfea..57fd959c9313b58687bc148b58dae4f29b7e3995 100644 (file)
@@ -1487,6 +1487,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
       return nir_intrinsic_load_local_invocation_id;
    case SYSTEM_VALUE_WORK_GROUP_ID:
       return nir_intrinsic_load_work_group_id;
+   case SYSTEM_VALUE_NUM_WORK_GROUPS:
+      return nir_intrinsic_load_num_work_groups;
    /* FINISHME: Add tessellation intrinsics.
    case SYSTEM_VALUE_TESS_COORD:
    case SYSTEM_VALUE_VERTICES_IN:
@@ -1523,6 +1525,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_num_work_groups:
+      return SYSTEM_VALUE_NUM_WORK_GROUPS;
    case nir_intrinsic_load_work_group_id:
       return SYSTEM_VALUE_WORK_GROUP_ID;
    /* FINISHME: Add tessellation intrinsics.
index 06f1b02383a0b01c6cfd992b53b23aa515798124..649312fec51e6652065c3540a4d1ac7e0f7ae449 100644 (file)
@@ -198,6 +198,7 @@ SYSTEM_VALUE(invocation_id, 1, 0)
 SYSTEM_VALUE(local_invocation_id, 3, 0)
 SYSTEM_VALUE(work_group_id, 3, 0)
 SYSTEM_VALUE(user_clip_plane, 4, 1) /* const_index[0] is user_clip_plane[idx] */
+SYSTEM_VALUE(num_work_groups, 3, 0)
 
 /*
  * The format of the indices depends on the type of the load.  For uniforms,