summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}