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 <robdclark@chromium.org>
/* 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);