Treat all non-zero GLboolean values as GL_TRUE. Note that this is left undefined by the spec, but glGetBoolean converts non-zero integers to GL_TRUE, so this makes things symmetric. Bug swiftshader:90 Change-Id: Ie2d3b2b8d66e63f542f758ddc6482b451fb4140d Reviewed-on: https://swiftshader-review.googlesource.com/c/21511 Tested-by: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/OpenGL/libGLESv2/libGLESv2.cpp b/src/OpenGL/libGLESv2/libGLESv2.cpp index d8a4a8f..fed303f 100644 --- a/src/OpenGL/libGLESv2/libGLESv2.cpp +++ b/src/OpenGL/libGLESv2/libGLESv2.cpp
@@ -650,7 +650,7 @@ if(context) { - context->setColorMask(red == GL_TRUE, green == GL_TRUE, blue == GL_TRUE, alpha == GL_TRUE); + context->setColorMask(red != GL_FALSE, green != GL_FALSE, blue != GL_FALSE, alpha != GL_FALSE); } } @@ -4239,7 +4239,7 @@ if(context) { - context->setSampleCoverageParams(es2::clamp01(value), invert == GL_TRUE); + context->setSampleCoverageParams(es2::clamp01(value), invert != GL_FALSE); } } @@ -5624,7 +5624,7 @@ return error(GL_INVALID_OPERATION); } - context->setVertexAttribState(index, context->getArrayBuffer(), size, type, (normalized == GL_TRUE), false, stride, ptr); + context->setVertexAttribState(index, context->getArrayBuffer(), size, type, (normalized != GL_FALSE), false, stride, ptr); } }
diff --git a/src/OpenGL/libGLESv2/libGLESv3.cpp b/src/OpenGL/libGLESv2/libGLESv3.cpp index 89055d8..ce2a3c8 100644 --- a/src/OpenGL/libGLESv2/libGLESv3.cpp +++ b/src/OpenGL/libGLESv2/libGLESv3.cpp
@@ -3679,7 +3679,7 @@ } es2::Texture2D *texture = context->getTexture2D(target); - if(!texture || texture->name == 0 || texture->getImmutableFormat() == GL_TRUE) + if(!texture || texture->name == 0 || texture->getImmutableFormat() != GL_FALSE) { return error(GL_INVALID_OPERATION); } @@ -3754,7 +3754,7 @@ } es2::Texture3D *texture = context->getTexture3D(); - if(!texture || texture->name == 0 || texture->getImmutableFormat() == GL_TRUE) + if(!texture || texture->name == 0 || texture->getImmutableFormat() != GL_FALSE) { return error(GL_INVALID_OPERATION); }