Skip to content

v3d/compiler: Lower geometry output store base into offset src

Neil Roberts requested to merge nroberts/mesa:v3d/fold-gs-write-offset into master

When generating the VPM write instruction for geometry shader outputs, emit_store_output_gs ends up adding the base and offset arguments together with an ADD instruction. The addition was done at the VIR level after scheduling so always it ends up right next to the corresponding stvpm instruction. Most of the time the offset is constant but nothing does any constant folding at the VIR level.

This patch makes it instead fold the addition into the offset at the NIR level in v3d_nir_lower_io so that the NIR-level constant folding can get rid of the addition most of the time.

Merge request reports