[Mesa-dev] Anonymous structure in uniform question

f.josef at email.cz f.josef at email.cz
Mon Nov 25 14:23:13 PST 2013

Hello Grigori,
indeed the patch cures the error, but when I was testing the newly compiled 

with XPlane10, it turns out there is something wrong - there are no shadows 

shadows I can't really tell if the patch didn't visibly break anything).

I'm going to try and find out where exactly the problem happened and will 
report back.

Thank you,


"On 21.11.2013 21:50, f.josef at email.cz wrote:
> The problem is, that each anonymous structure gets its own unique type,
> without checking if such type already exists. It seems to me, that such
> code is somewhat in the gray area - the rest of OpenGL implementations
> doesn't seem to have a problem with this code (Intel on Win, OSX, Nvidia
> and AMD drivers in Win, OSX and Linux), which of course doesn't mean
> such a behavior is correct.

This should be allowed, according to GLSL (3.3) spec and grammar. It's 
just a bug/oversight in the linker, I guess. The GLSL linker already 
includes some special handling to match array types between stages. I 
added something similar for structs, see the attached patch. It's 
probably not the nicest approach (it duplicates some code from 
glsl_types.cpp), but seems to work fine. I don't really know the GLSL 
compiler/linker code, so YMMV. :)

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131125/8ce60df7/attachment.html>

More information about the mesa-dev mailing list