aco: fix emitting discard when the program just ends
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 24 May 2021 15:05:30 +0000 (17:05 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 26 May 2021 10:32:59 +0000 (10:32 +0000)
commit729ebe4b17f0905f87f41c0ffe004e042f3c55f6
tree165134ac871b2ef14189cbb0530e014311c3fe88
parent5283c6d47bfb448061c6a9b3805506d192794f26
aco: fix emitting discard when the program just ends

For fragment shaders that only contain a discard, the exec mask has
to be zero'd and everything discarded.

It seems unnecessary to emit an export here because if the FS has no
exports, the compiler already emits a null export at the end.

Fixes incorrect hair rendering in Detroit: Become Human.

fossil-db (Sienna Cichlid):
Totals from 3 (0.00% of 149839) affected shaders:
CodeSize: 2896 -> 2872 (-0.83%)
Instrs: 556 -> 553 (-0.54%)
Latency: 29266 -> 29214 (-0.18%)
InvThroughput: 3374 -> 3372 (-0.06%)

Cc: 21.1 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10955>
src/amd/compiler/aco_instruction_selection.cpp