From f697f61590fcdbba624749ce535f5a8f7b0267a5 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 2 May 2019 09:25:36 -0700 Subject: [PATCH] freedreno/ir3: fix lowered ubo region alignment Since we emit UBO regions INDIRECTly (ie. not copied into cmdstream but emit by EXT_SRC_ADDR) we need to keep them 4*vec4 aligned. Which the code already mostly did, except for aligning the first UBO region itself (ie. the one after block==0 which is the "real" uniforms). Fixes: 893425a607a freedreno/ir3: Push UBOs to constant file Fixes: 3c8779af325 freedreno/ir3: Enable PIPE_CAP_PACKED_UNIFORMS Signed-off-by: Rob Clark --- src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c index aaa2a86..a79b1a3 100644 --- a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c +++ b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c @@ -126,7 +126,7 @@ ir3_nir_analyze_ubo_ranges(nir_shader *nir, struct ir3_shader *shader) struct ir3_ubo_analysis_state *state = &shader->ubo_state; memset(state, 0, sizeof(*state)); - state->range[0].end = nir->num_uniforms * 16; + state->range[0].end = align(nir->num_uniforms * 16, 16 * 4); /* align to 4*vec4 */ nir_foreach_function(function, nir) { if (function->impl) { -- 2.7.4