[Mesa-dev] Lazy GLSL built-in importing bug fix

Kenneth Graunke kenneth at whitecape.org
Fri Nov 11 02:56:13 PST 2011


While looking at some oglconform failures the other day, I noticed some of
their shaders were trying to use % on a float and failing to compile.

It turned out to be a nasty bug in my lazy built-in importing code.  The
shader was calling abs() on an int, but we selected abs(float) instead of
abs(int), resulting in an implicit conversion to float and eventually
bizarre looking type errors.

Patch 3 fixes that bug.  The first adds a bit of infrastructure to make it
easier, and the second splits up a function to preserve some sanity.

I'm pretty happy with the new code, as it's quite a bit easier to follow.
Still embarassed that I wrote that mess in the first place though. :)



More information about the mesa-dev mailing list