Bug 1129213 - Support non-UINT32_MAX initial values for STENCIL_VALUE_MASK. - r=kamidphish

This commit is contained in:
Jeff Gilbert 2015-02-04 15:07:32 -08:00
parent 66223ceeb0
commit 5533ff3254

View File

@ -1123,8 +1123,15 @@ WebGLContext::AssertCachedState()
AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_REF, stencilRefMask, mStencilRefFront);
AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_REF, stencilRefMask, mStencilRefBack);
AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_VALUE_MASK, mStencilValueMaskFront);
AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_VALUE_MASK, mStencilValueMaskBack);
// GLES 3.0.4, $4.1.4, p177:
// [...] the front and back stencil mask are both set to the value `2^s - 1`, where
// `s` is greater than or equal to the number of bits in the deepest stencil buffer
// supported by the GL implementation.
const int maxStencilBits = 8;
const GLuint maxStencilBitsMask = (1 << maxStencilBits) - 1;
AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_VALUE_MASK, maxStencilBitsMask, mStencilValueMaskFront);
AssertMaskedUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_VALUE_MASK, maxStencilBitsMask, mStencilValueMaskBack);
AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_WRITEMASK, mStencilWriteMaskFront);
AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_WRITEMASK, mStencilWriteMaskBack);