nir: add missing local_group_size intrinsic
authorRob Clark <robdclark@gmail.com>
Mon, 25 Dec 2017 20:18:00 +0000 (15:18 -0500)
committerRob Clark <robdclark@gmail.com>
Sat, 30 Dec 2017 17:39:07 +0000 (12:39 -0500)
For GL_ARB_compute_variable_group_size

Reported-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir.c
src/compiler/nir/nir_intrinsics.h

index 688f2b1ae322950c19331d85ead00013e145f23b..692d97bf9aab477e1703787ccba7e58bc510051c 100644 (file)
@@ -1969,6 +1969,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
       return nir_intrinsic_load_subgroup_le_mask;
    case SYSTEM_VALUE_SUBGROUP_LT_MASK:
       return nir_intrinsic_load_subgroup_lt_mask;
+   case SYSTEM_VALUE_LOCAL_GROUP_SIZE:
+      return nir_intrinsic_load_local_group_size;
    default:
       unreachable("system value does not directly correspond to intrinsic");
    }
@@ -2038,6 +2040,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
       return SYSTEM_VALUE_SUBGROUP_LE_MASK;
    case nir_intrinsic_load_subgroup_lt_mask:
       return SYSTEM_VALUE_SUBGROUP_LT_MASK;
+   case nir_intrinsic_load_local_group_size:
+      return SYSTEM_VALUE_LOCAL_GROUP_SIZE;
    default:
       unreachable("intrinsic doesn't produce a system value");
    }
index ccf8e06336cb99fe2eb92f0be3fe891945dbdbc0..ede292778767e518c71a6ba3ef7c0683f5fa8fd2 100644 (file)
@@ -363,6 +363,7 @@ SYSTEM_VALUE(subgroup_gt_mask, 0, 0, xx, xx, xx)
 SYSTEM_VALUE(subgroup_le_mask, 0, 0, xx, xx, xx)
 SYSTEM_VALUE(subgroup_lt_mask, 0, 0, xx, xx, xx)
 SYSTEM_VALUE(subgroup_id, 1, 0, xx, xx, xx)
+SYSTEM_VALUE(local_group_size, 3, 0, xx, xx, xx)
 
 /* Blend constant color values.  Float values are clamped. */
 SYSTEM_VALUE(blend_const_color_r_float, 1, 0, xx, xx, xx)