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;
}
#ifdef DEBUG
// For NaNs, etc.
static bool IsSameFloat(float a, float b) {
return (a == b) || (IsNaN(a) && IsNaN(b));
}
#endif
void
WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield mask)
{
@ -1200,10 +1207,10 @@ WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield mask)
colorWriteMask[1] == mColorWriteMask[1] &&
colorWriteMask[2] == mColorWriteMask[2] &&
colorWriteMask[3] == mColorWriteMask[3]);
MOZ_ASSERT(colorClearValue[0] == mColorClearValue[0] &&
colorClearValue[1] == mColorClearValue[1] &&
colorClearValue[2] == mColorClearValue[2] &&
colorClearValue[3] == mColorClearValue[3]);
MOZ_ASSERT(IsSameFloat(mColorClearValue[0], colorClearValue[0]) &&
IsSameFloat(mColorClearValue[0], colorClearValue[0]) &&
IsSameFloat(mColorClearValue[0], colorClearValue[0]) &&
IsSameFloat(mColorClearValue[0], colorClearValue[0]));
realGLboolean depthWriteMask = 2;
@ -1213,7 +1220,7 @@ WebGLContext::ForceClearFramebufferWithDefaultValues(GLbitfield mask)
gl->fGetFloatv(LOCAL_GL_DEPTH_CLEAR_VALUE, &depthClearValue);
MOZ_ASSERT(depthWriteMask == mDepthWriteMask);
MOZ_ASSERT(depthClearValue == mDepthClearValue);
MOZ_ASSERT(IsSameFloat(mDepthClearValue, depthClearValue));
GLuint stencilWriteMaskFront = 0xdeadbad1;