asahi: Identify & disable triangle merging for shaders using derivatives
authorAsahi Lina <lina@asahilina.net>
Fri, 9 Dec 2022 12:47:29 +0000 (21:47 +0900)
committerMarge Bot <emma+marge@anholt.net>
Sat, 17 Dec 2022 18:10:28 +0000 (18:10 +0000)
commitc12153cd89254102e3dd2422d5b4ec4d1b63c8bf
tree00f25b8d25813f5a2234ea58b042171dbb64c3cb
parent005f556065d18675ae47532d0058286a41b541af
asahi: Identify & disable triangle merging for shaders using derivatives

It seems triangle merging is incompatible with calculating derivatives
along primitive edges correctly. Take the appropriate NIR shader info
flags in the compiler and pass them down as a flag to the driver, so it
can set the disable triangle merging flag (formerly called "lines or
points").

TODO: Is this what macOS does when you set a sample mask there (which
apparently fixes the same bug on the Darwinia Metal backend)? Do we
also need to set this when sample masks are used?

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes Darwinia and dEQP2 projected tests.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
src/asahi/compiler/agx_compile.c
src/asahi/compiler/agx_compile.h
src/asahi/lib/cmdbuf.xml
src/gallium/drivers/asahi/agx_state.c