Date: 2010-01-29 15:03:17 +0000 (Fri, 29 Jan 2010)
Fixed bug 263: trouble using 'colour' GLSL custom attribute
Actually the remaining problem was that finding an attribute near the start of the file could accidentally wrap around because of a negative value for the start point, so glBindAttribLocationARB was never called to set the attribute to the fixed value (in this case 3). The GLSL compiler would then assign it a value (in this case 1) which didn't match. We don't let the GLSL compiler assign attribute numbers because some drivers are broken and accidentally alias attributes, leading to massive performance drops.
--- branches/v1-7/RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgram.cpp 2010-01-29 13:17:58 UTC (rev 9660)
+++ branches/v1-7/RenderSystems/GL/src/GLSL/src/OgreGLSLLinkProgram.cpp 2010-01-29 15:03:17 UTC (rev 9661)
@@ -176,7 +176,7 @@
String::size_type pos = vpSource.find(a.name);
if (pos != String::npos)
- String::size_type startpos = vpSource.find("attribute", pos-20);
+ String::size_type startpos = vpSource.find("attribute", pos < 20 ? 0 : pos-20);
if (startpos == String::npos)
startpos = vpSource.find("in", pos-20);
if (startpos != String::npos && startpos < pos)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.