nir: handle wildcard array deref

Here we add handling of wildcard array derefs when attempting to mark
an io as partially used rather than hitting an assert.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31137>
This commit is contained in:
Timothy Arceri 2024-07-15 14:19:34 +10:00 committed by Marge Bot
parent 6bb6b0e5ad
commit fe9b93fc1c

View file

@ -235,6 +235,10 @@ get_io_offset(nir_deref_instr *deref, nir_variable *var, bool is_arrayed,
assert(glsl_type_is_array(var->type));
return 0;
}
if (deref->deref_type == nir_deref_type_array_wildcard)
return -1;
assert(deref->deref_type == nir_deref_type_array);
return nir_src_is_const(deref->arr.index) ? (nir_src_as_uint(deref->arr.index) + var->data.location_frac) / 4u : (unsigned)-1;
}