From 32925f407248dfdd6994523d7a895112da8a82ae Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 1 May 2019 10:41:51 -0700 Subject: [PATCH] freedreno/ir3: fix shader variants vs UBO analysis Otherwise we zero out the state again, but all the UBO loads that we could lower are already lowered. End result is that we didn't emit the uniforms for lowered UBO access in any case where multiple shader variants are used. 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.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c index 76230e3be50..43b9c4d7287 100644 --- a/src/freedreno/ir3/ir3_nir.c +++ b/src/freedreno/ir3/ir3_nir.c @@ -228,8 +228,10 @@ ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s, /* do ubo load and idiv lowering after first opt loop to get a chance to * propagate constants for divide by immed power-of-two and constant ubo * block/offsets: + * + * NOTE that UBO analysis pass should only be done once, before variants */ - const bool ubo_progress = OPT(s, ir3_nir_analyze_ubo_ranges, shader); + const bool ubo_progress = !key && OPT(s, ir3_nir_analyze_ubo_ranges, shader); const bool idiv_progress = OPT(s, nir_lower_idiv); if (ubo_progress || idiv_progress) ir3_optimize_loop(s); -- 2.30.2