panfrost: Effectively lower gl_FragColor late
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 7 Feb 2023 05:02:51 +0000 (00:02 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 23 Mar 2023 23:53:46 +0000 (23:53 +0000)
commit683d1b60785f2b33466964124e7e419fb05331d8
treed952ce8950c93dce7294aca629e72b59e2c28fe6
parentb722410544a7988baf666a70d5fb9be17a81510a
panfrost: Effectively lower gl_FragColor late

nir_lower_fragcolor takes the number of colour buffers as input, but it's an
early pass, so we don't want to use the key for it. Instead, we can overestimate
and then optimize out late with an easy pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
src/gallium/drivers/panfrost/meson.build
src/gallium/drivers/panfrost/pan_context.h
src/gallium/drivers/panfrost/pan_nir_remove_fragcolor_stores.c [new file with mode: 0644]
src/gallium/drivers/panfrost/pan_shader.c