Skip to content

freedreno: constlen fixes

Emma Anholt requested to merge anholt/mesa:freedreno-constlen into master

This series was primarily motivated by having thrown an assert in ir3_gallium.c to make sure that we don't upload more than constlen constants. We violated that in several places, which I hope is why we've had to have WFIs in the constant upload path (Theory: you can't emit new constants until the previous shaders are done, because the HW might allocate your new shader's constant space just before a previous program).

My solution is to decouple const_state between binning and rendering. It saves us needing some fragile code and it saves GPU time uploading unused constants in the binning stage (~2% reduction in constlen in shader-db). Hopefully once we drop the WFIs, the reduced constlens will also reduce pipeline bubbles that would have happened.

We can do better than this, too. We should be able to upload immediates once in the stateobj creation and never again (I have a branch for this that needs debugging), which will hopefully get our CPU overhead back down to below the shared bin/render constant state case. If we optimize our NIR to DCE unused outputs in the binning case, we can probably cut out bunch more driver params and UBO pointers for binning shaders.

gles3-master.txt passed, working on the others.

Merge request reports