From: Dave Airlie Date: Fri, 19 Jun 2020 07:11:12 +0000 (+1000) Subject: gallivm/nir: fix const compact X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d7aed02bccae41c68c06002bab42c9efe166e68e;p=mesa.git 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 Part-of: --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index 99b35cfccd6..b9fb3393a7c 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -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;