Bug 636942 - stencil separate param validation must now occur on draw calls - r=jrmuizel

We were validating these params when they're set, and that was non-conformant behavior.
This commit is contained in:
Benoit Jacob
2011-05-20 15:53:53 -04:00
parent 2ce001ca84
commit b99aeb3a4b
7 changed files with 71 additions and 22 deletions

View File

@@ -419,6 +419,24 @@ PRBool WebGLContext::ValidateAttribIndex(WebGLuint index, const char *info)
}
}
PRBool WebGLContext::ValidateStencilParamsForDrawCall()
{
const char *msg = "%s set different front and back stencil %s. Drawing in this configuration is not allowed.";
if (mStencilRefFront != mStencilRefBack) {
ErrorInvalidOperation(msg, "stencilFuncSeparate", "reference values");
return PR_FALSE;
}
if (mStencilValueMaskFront != mStencilValueMaskBack) {
ErrorInvalidOperation(msg, "stencilFuncSeparate", "value masks");
return PR_FALSE;
}
if (mStencilWriteMaskFront != mStencilWriteMaskBack) {
ErrorInvalidOperation(msg, "stencilMaskSeparate", "write masks");
return PR_FALSE;
}
return PR_TRUE;
}
PRBool
WebGLContext::InitAndValidateGL()
{