[Mesa-dev] [PATCH] glsl2: do not create __retval names (two underscores is a reserved name)

Aras Pranckevicius aras at unity3d.com
Mon Aug 9 12:00:55 PDT 2010

> > Attached patch changes __retval variable to _ret_val. According to GLSL
> > spec, "all identifiers containing two consecutive underscores are
> reserved
> > as possible future keywords". Windows Radeon 5xxx drivers actually
> complain
> > about this case.
> You definitely need something to process names to produce unique, safe
> names for usage in your GLSL-to-GLSL compiler.  The names used
> internally in the compiler are not unique or safe to use as identifiers
> in GLSL.

Yeah, I realized that patch is not directly related to Mesa just after
sending it. Oh well.

Otherwise, I do explicitly unique-ify the names in my GLSL-to-GLSL compiler
fork (e.g. append unique postfixes to local variables after inlining, etc.).
I haven't ran into other issues yet, except this double underscore thing in

Aras Pranckevičius
work: http://unity3d.com
home: http://aras-p.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100809/5698c873/attachment.html>

More information about the mesa-dev mailing list