We need the constants uploaded to cover the NIR offset plus the size,
not the aligned-down start of our upload range plus the size. Fixes
mistaken UBO analysis with mat3 loads.
Fixes: 893425a607a6 ("freedreno/ir3: Push UBOs to constant file")
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
{
struct ir3_ubo_range r;
+ const int offset = nir_src_as_uint(instr->src[1]);
const int bytes = nir_intrinsic_dest_components(instr) * 4;
- r.start = ROUND_DOWN_TO(nir_src_as_uint(instr->src[1]), 16 * 4);
- r.end = ALIGN(r.start + bytes, 16 * 4);
+ r.start = ROUND_DOWN_TO(offset, 16 * 4);
+ r.end = ALIGN(offset + bytes, 16 * 4);
return r;
}