diff --git a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c index 63e487f10c8..622f1d6f729 100644 --- a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c +++ b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c @@ -545,6 +545,8 @@ ir3_nir_lower_const_global_loads(nir_shader *nir, struct ir3_shader_variant *v) if (ir3_shader_debug & IR3_DBG_NOUBOOPT) return false; + uint32_t align_vec4 = const_align_vec4(compiler); + unsigned max_upload; uint32_t global_offset = 0; if (v->binning_pass) { @@ -569,7 +571,7 @@ ir3_nir_lower_const_global_loads(nir_shader *nir, struct ir3_shader_variant *v) if (instr_is_load_const(instr) && ir3_def_is_rematerializable_for_preamble(nir_instr_as_intrinsic(instr)->src[0].ssa, NULL)) gather_ubo_ranges(nir, nir_instr_as_intrinsic(instr), &state, - compiler->const_upload_unit, + align_vec4, &upload_remaining); } } @@ -595,7 +597,7 @@ ir3_nir_lower_const_global_loads(nir_shader *nir, struct ir3_shader_variant *v) continue; progress |= lower_ubo_load_to_uniform( nir_instr_as_intrinsic(instr), &builder, &state, NULL, - compiler->const_upload_unit); + align_vec4); } } @@ -651,7 +653,7 @@ ir3_nir_analyze_ubo_ranges(nir_shader *nir, struct ir3_shader_variant *v) nir_foreach_instr (instr, block) { if (instr_is_load_ubo(instr)) gather_ubo_ranges(nir, nir_instr_as_intrinsic(instr), state, - compiler->const_upload_unit, + align_vec4, &upload_remaining); } } @@ -678,6 +680,8 @@ ir3_nir_lower_ubo_loads(nir_shader *nir, struct ir3_shader_variant *v) const struct ir3_const_state *const_state = ir3_const_state(v); const struct ir3_ubo_analysis_state *state = &const_state->ubo_state; + uint32_t align_vec4 = const_align_vec4(compiler); + int num_ubos = 0; bool progress = false; bool has_preamble = false; @@ -696,7 +700,7 @@ ir3_nir_lower_ubo_loads(nir_shader *nir, struct ir3_shader_variant *v) continue; progress |= lower_ubo_load_to_uniform( nir_instr_as_intrinsic(instr), &builder, state, &num_ubos, - compiler->const_upload_unit); + align_vec4); } }