Bug 860543 - Allow for testing predictions of shadowed NaNs. - r=bjacob

This commit is contained in:
Jeff Gilbert 2013-06-19 20:03:46 -07:00
parent 20529abdec
commit abdc328c4a

View File

@ -1169,6 +1169,13 @@ WebGLContext::ClearScreen()
mIsScreenCleared = true; mIsScreenCleared = true;
} }
#ifdef DEBUG
// For NaNs, etc.
static bool IsSameFloat(float a, float b) {
return (a == b) || (IsNaN(a) && IsNaN(b));
}
#endif
void void
WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield mask) WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield mask)
{ {
@ -1200,10 +1207,10 @@ WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield mask)
colorWriteMask[1] == mColorWriteMask[1] && colorWriteMask[1] == mColorWriteMask[1] &&
colorWriteMask[2] == mColorWriteMask[2] && colorWriteMask[2] == mColorWriteMask[2] &&
colorWriteMask[3] == mColorWriteMask[3]); colorWriteMask[3] == mColorWriteMask[3]);
MOZ_ASSERT(colorClearValue[0] == mColorClearValue[0] && MOZ_ASSERT(IsSameFloat(mColorClearValue[0], colorClearValue[0]) &&
colorClearValue[1] == mColorClearValue[1] && IsSameFloat(mColorClearValue[0], colorClearValue[0]) &&
colorClearValue[2] == mColorClearValue[2] && IsSameFloat(mColorClearValue[0], colorClearValue[0]) &&
colorClearValue[3] == mColorClearValue[3]); IsSameFloat(mColorClearValue[0], colorClearValue[0]));
realGLboolean depthWriteMask = 2; realGLboolean depthWriteMask = 2;
@ -1212,8 +1219,8 @@ WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield mask)
gl->fGetBooleanv(LOCAL_GL_DEPTH_WRITEMASK, &depthWriteMask); gl->fGetBooleanv(LOCAL_GL_DEPTH_WRITEMASK, &depthWriteMask);
gl->fGetFloatv(LOCAL_GL_DEPTH_CLEAR_VALUE, &depthClearValue); gl->fGetFloatv(LOCAL_GL_DEPTH_CLEAR_VALUE, &depthClearValue);
MOZ_ASSERT(depthWriteMask == mDepthWriteMask); MOZ_ASSERT(depthWriteMask == mDepthWriteMask);
MOZ_ASSERT(depthClearValue == mDepthClearValue); MOZ_ASSERT(IsSameFloat(mDepthClearValue, depthClearValue));
GLuint stencilWriteMaskFront = 0xdeadbad1; GLuint stencilWriteMaskFront = 0xdeadbad1;