zink: Always set a blend state for shader-db
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 10 May 2023 18:01:23 +0000 (14:01 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 11 May 2023 21:29:47 +0000 (21:29 +0000)
commit95d93b24f639907d6e8d504c87f9908c7eb60cbc
tree67e589ab2c05d5150417f8104f5211efa5e7f16f
parentd3bdddcf2ae4d00719f4ade1ecd062784c0bea7e
zink: Always set a blend state for shader-db

If we're compiling shaders in shader-db, with shader-db's ./run and
ZINK_DEBUG=shaderdb, we won't get much state set on the graphics pipeline, since
shader-db doesn't actually do any rendering. For a driver like RADV, that is
*almost* ok... Since we use dynamic vertex input, we don't need to make up any
state for vertex inputs; since we use dynamic rendering, we don't need to make
up any render attachments. All of that being said, we *do* need to make up a
blend state to ensure that the Vulkan driver doesn't optimize away all of
store_derefs in the fragment shader (and in turn, optimize the entire fragment
shader away, if there are no image/SSBO writes.) So set the obvious blend state,
fixing fragment shaders in shader-db with zink + radv.

I don't know why other people would want to use Zink with shader-db, but for me
it's an easy way to test ACO, at least until radeonsi gains aco support.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22948>
src/gallium/drivers/zink/zink_context.c