i965: Only call lower_blend_equation_advanced for fragment shaders
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 13 Sep 2021 22:47:47 +0000 (15:47 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 14 Sep 2021 03:55:05 +0000 (03:55 +0000)
commitbec8f8fde84e3b6d474da4b0153e8c95a99e337e
treed718993ee2c650771e1686fdf5b6eee869da6393
parentca92a0d1ae8d7d393643d8abef10288e95b5e7b2
i965: Only call lower_blend_equation_advanced for fragment shaders

i965 called this pass unconditionally, while st/mesa only calls it for
fragment shaders.  It only makes sense to run for fragment shaders, and
the first thing the pass does is read a FS-specific field out of a
union.  This isn't safe for other stages.

Fixes about 20,630 test failures on i965 since 91dc863921a, which moved
the advanced_blend_modes field.  The field had previously been in a
union with no other fields, so it never aliased anything, and thus
worked, even if it was wrong.  That commit moved it to a union that had
fields for other stages, so it started reading garbage and trying to
lower advanced blending for other stages on i965.

Fixes: 91dc863921a ("mesa: Move the advanced blend bitmask to shader_info.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12839>
src/mesa/drivers/dri/i965/brw_link.cpp