Skip to content

Draft: ac/nir/ngg: Add ability to reuse some output variables.

Timur Kristóf requested to merge Venemo/mesa:ac_nir_nggc_more_reuse into main

Based on !22073 (closed)

ac_nir_lower_ngg will try to find outputs (other than the position) which are already calculated as part of the position.

It will then repack these variables after culling (using LDS), and reuse them to reduce the execution time of the deferred shader part. This prevents wasting ALU on computing things that have already been computed as part of the position.

Each repacked-reused dword costs 4 bytes of LDS per vertex and an additional VGPR used (due to the case when culling is off and repacking doesn't happen).

Marked as WIP until the pre-requisite is merged. Also need to generate Fossil DB stats.

Edited by Timur Kristóf

Merge request reports