Bug 636002 - better messages about attrib index validation - r=jrmuizel, a=joe

This commit is contained in:
Benoit Jacob
2011-02-24 17:17:34 -05:00
parent e67bcf27fb
commit 6602209cd0
3 changed files with 30 additions and 10 deletions

View File

@@ -376,6 +376,22 @@ PRBool WebGLContext::ValidateTexFormatAndType(WebGLenum format, WebGLenum type,
}
}
PRBool WebGLContext::ValidateAttribIndex(WebGLuint index, const char *info)
{
if (index > mAttribBuffers.Length()) {
if (index == WebGLuint(-1)) {
ErrorInvalidValue("%s: index -1 is invalid. That probably comes from a getAttribLication() call, "
"where this return value -1 means that the passed name didn't correspond to an active attribute in "
"the specified program.", info);
} else {
ErrorInvalidValue("%s: index %d is out of range", info, index);
}
return PR_FALSE;
} else {
return PR_TRUE;
}
}
PRBool
WebGLContext::InitAndValidateGL()
{