Since adding support for compacts this crashes with indirects
don't get the const address unless it's a const.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>
uint32_t const_offset = 0;
LLVMValueRef offset = NULL;
- if (var->data.compact) {
+ if (var->data.compact && nir_src_is_const(instr->arr.index)) {
assert(instr->deref_type == nir_deref_type_array);
const_offset = nir_src_as_uint(instr->arr.index);
goto out;