back out 1b09c80c46c3 (bug 680722, WebGL shader validation) because of regression, see bug 684312 and 683710

This commit is contained in:
Benoit Jacob
2011-09-02 15:43:03 -04:00
parent aaf577e196
commit e59d72eaed
7 changed files with 11 additions and 89 deletions

View File

@@ -328,31 +328,14 @@ PRBool WebGLContext::ValidateDrawModeEnum(WebGLenum mode, const char *info)
}
}
bool WebGLContext::ValidateGLSLVariableName(const nsAString& name, const char *info)
bool WebGLContext::ValidateGLSLIdentifier(const nsAString& name, const char *info)
{
const PRUint32 maxSize = 255;
const PRUint32 maxSize = 4095;
if (name.Length() > maxSize) {
ErrorInvalidValue("%s: identifier is %d characters long, exceeds the maximum allowed length of %d characters",
info, name.Length(), maxSize);
return false;
}
if (!ValidateGLSLString(name, info)) {
return false;
}
return true;
}
bool WebGLContext::ValidateGLSLString(const nsAString& string, const char *info)
{
for (PRUint32 i = 0; i < string.Length(); ++i) {
if (!ValidateGLSLCharacter(string.CharAt(i))) {
ErrorInvalidValue("%s: string contains the illegal character '%d'", info, string.CharAt(i));
return false;
}
}
return true;
}