summaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-06-06 14:27:13 -0700
committerEric Anholt <[email protected]>2019-06-21 17:14:43 -0700
commit56842d33d53f3ea76b9359e8ead2ea4487e62dc1 (patch)
tree0d1a7f1cef82c1a321b2d3b9869b18b685b1f94d /src/freedreno/ir3
parent5e7c96b95df0f2d792820a27b278a95a90893e4a (diff)
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: 893425a607a6 ("freedreno/ir3: Push UBOs to constant file") Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno/ir3')
-rw-r--r--src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
index aaf962977b3..46216a6f862 100644
--- a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
+++ b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
@@ -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;
}