ac/nir: Use gs_accepted variable after culling.
authorTimur Kristóf <timur.kristof@gmail.com>
Thu, 15 Jul 2021 12:32:34 +0000 (14:32 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 2 Aug 2021 11:38:25 +0000 (11:38 +0000)
commita2d02c0c11009a7018e9760ed44d38131ccfd195
tree13c77587a8345d358e3534018a3d87f0091dfb9b
parent8159868699c1b64ed7f3935b57c890908b66e897
ac/nir: Use gs_accepted variable after culling.

This prevents us from recalculating the EXEC mask later
in the shader, and removes the requirement for
counting the number of primitives.

The stats are better than expected because they also
show that some code that is still there is now DCE'd by ACO.

Fossil DB results on Sienna Cichlid (with NGGC on):

Totals from 58239 (45.27% of 128647) affected shaders:
SpillSGPRs: 330 -> 340 (+3.03%)
CodeSize: 166356072 -> 162805724 (-2.13%)
Instrs: 31920041 -> 31089256 (-2.60%)
Latency: 138815742 -> 138113669 (-0.51%); split: -0.54%, +0.03%
InvThroughput: 22459553 -> 22404840 (-0.24%); split: -0.26%, +0.02%
SClause: 753746 -> 753765 (+0.00%); split: -0.00%, +0.01%
Copies: 3226647 -> 3268973 (+1.31%); split: -0.45%, +1.76%
Branches: 1223441 -> 1223440 (-0.00%); split: -0.00%, +0.00%
PreSGPRs: 2025339 -> 2091013 (+3.24%)

No Fossil DB changes with NGGC off.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11908>
src/amd/common/ac_nir_lower_ngg.c