https://bugs.freedesktop.org/show_bug.cgi?id=107864
--- Comment #1 from Ilia Mirkin imirkin@alum.mit.edu --- Adding
else { fragColor = vec4(0); }
at the bottom of mainImage appears to "fix" it. fragColor is otherwise ending up with random values (effectively whatever happened to be in the registers, probably left over from the division check).
I don't think this is a bug in mesa.