Maybe there is a better way to do this. But by the time we get to
assigning uniform locs, we want the atomic_uint's to all be gone,
otherwise we assert in st_glsl_attrib_type_size().
Signed-off-by: Rob Clark <robdclark@gmail.com>
return true;
}
+static bool
+is_atomic_uint(const struct glsl_type *type)
+{
+ if (glsl_get_base_type(type) == GLSL_TYPE_ARRAY)
+ return is_atomic_uint(glsl_get_array_element(type));
+ return glsl_get_base_type(type) == GLSL_TYPE_ATOMIC_UINT;
+}
+
bool
nir_lower_atomics_to_ssbo(nir_shader *shader, unsigned ssbo_offset)
{
/* replace atomic_uint uniforms with ssbo's: */
unsigned replaced = 0;
nir_foreach_variable_safe(var, &shader->uniforms) {
- if (glsl_get_base_type(var->type) == GLSL_TYPE_ATOMIC_UINT) {
+ if (is_atomic_uint(var->type)) {
exec_node_remove(&var->node);
if (replaced & (1 << var->data.binding))