It only makes sense to call this pass for fragment shaders, and the
first thing the pass does is read a FS-specific field out of a union,
so it isn't safe to call it for other shader stages.
We could make it early return, but instead we just assert, so that
drivers know to only call it when appropriate.
(A previous version of this patch, which early returned instead of
asserting, was Reviewed-by: Emma Anholt <emma@anholt.net> as well.)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12839>
bool
lower_blend_equation_advanced(struct gl_linked_shader *sh, bool coherent)
{
+ assert(sh->Stage == MESA_SHADER_FRAGMENT);
+
if (sh->Program->info.fs.advanced_blend_modes == 0)
return false;