gallivm/nir: fix const compact
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>
This commit is contained in:
@@ -922,7 +922,7 @@ get_deref_offset(struct lp_build_nir_context *bld_base, nir_deref_instr *instr,
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user