Skip to content
Snippets Groups Projects
Commit 56842d33 authored by Emma Anholt's avatar Emma Anholt
Browse files

freedreno: Fix up end range of unaligned UBO loads.


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: 893425a6 ("freedreno/ir3: Push UBOs to constant file")
Reviewed-by: default avatarKristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
parent 5e7c96b9
No related branches found
No related tags found
No related merge requests found
......@@ -32,10 +32,11 @@ get_ubo_load_range(nir_intrinsic_instr *instr)
{
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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment