Limit copied uniform and vertex attribute names to the implicit size of the
buffers passed in. Increase the size of the buffer the client will allocate
for mapped names to be equal to the maximum token length.
BUG=http://code.google.com/p/angleproject/issues/detail?id=234
TEST=WebGL conformance test to be checked in soon
Review URL: http://codereview.appspot.com/5306063
git-svn-id: https://angleproject.googlecode.com/svn/trunk@804 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/MapLongVariableNames.cpp b/src/compiler/MapLongVariableNames.cpp
index 8f35560..0b91f8c 100644
--- a/src/compiler/MapLongVariableNames.cpp
+++ b/src/compiler/MapLongVariableNames.cpp
@@ -10,13 +10,13 @@
TString mapLongName(int id, const TString& name, bool isVarying)
{
- ASSERT(name.size() > MAX_IDENTIFIER_NAME_SIZE);
+ ASSERT(name.size() > MAX_SHORTENED_IDENTIFIER_SIZE);
TStringStream stream;
stream << "webgl_";
if (isVarying)
stream << "v";
stream << id << "_";
- stream << name.substr(0, MAX_IDENTIFIER_NAME_SIZE - stream.str().size());
+ stream << name.substr(0, MAX_SHORTENED_IDENTIFIER_SIZE - stream.str().size());
return stream.str();
}
@@ -31,7 +31,7 @@
void MapLongVariableNames::visitSymbol(TIntermSymbol* symbol)
{
ASSERT(symbol != NULL);
- if (symbol->getSymbol().size() > MAX_IDENTIFIER_NAME_SIZE) {
+ if (symbol->getSymbol().size() > MAX_SHORTENED_IDENTIFIER_SIZE) {
switch (symbol->getQualifier()) {
case EvqVaryingIn:
case EvqVaryingOut: