vc4: Add a constant folding pass

Graphics / Mesa 3D Graphics Library / Mesa - Eric Anholt [anholt.net] - 30 March 2015 14:57 UTC

This cleans up some pointless operations generated by the in-driver mul24 lowering (commonly generated by making a vec4 index for a matrix in a uniform array).

I could fill in other operations, but pretty much anything else ought to be getting handled at the NIR level, I think.

total uniforms in shared programs: 13423 -> 13421 (-0.01%) uniforms in affected programs: 346 -> 344 (-0.58%)

8c5dcdb vc4: Add a constant folding pass.
src/gallium/drivers/vc4/Makefile.sources | 1 +
src/gallium/drivers/vc4/vc4_opt_constant_folding.c | 110 ++++++++++++++++++++
src/gallium/drivers/vc4/vc4_qir.c | 1 +
src/gallium/drivers/vc4/vc4_qir.h | 1 +
4 files changed, 113 insertions(+)

Upstream: cgit.freedesktop.org


  • Share