From: Rob Clark Date: Wed, 1 May 2019 17:41:51 +0000 (-0700) Subject: freedreno/ir3: fix shader variants vs UBO analysis X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32925f407248dfdd6994523d7a895112da8a82ae;p=mesa.git 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 --- 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);