Commit 51814273 by Nicolas Capens Committed by Nicolas Capens

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/21511Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 767b41b1
...@@ -607,7 +607,7 @@ void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) ...@@ -607,7 +607,7 @@ void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
if(context) 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);
} }
} }
...@@ -649,7 +649,7 @@ void VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normal ...@@ -649,7 +649,7 @@ void VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normal
if(context) if(context)
{ {
context->setVertexAttribState(index, context->getArrayBuffer(), size, type, (normalized == GL_TRUE), stride, ptr); context->setVertexAttribState(index, context->getArrayBuffer(), size, type, (normalized != GL_FALSE), stride, ptr);
} }
} }
...@@ -3473,7 +3473,7 @@ void SampleCoverage(GLclampf value, GLboolean invert) ...@@ -3473,7 +3473,7 @@ void SampleCoverage(GLclampf value, GLboolean invert)
if(context) if(context)
{ {
context->setSampleCoverageParams(es1::clamp01(value), invert == GL_TRUE); context->setSampleCoverageParams(es1::clamp01(value), invert != GL_FALSE);
} }
} }
......
...@@ -650,7 +650,7 @@ void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) ...@@ -650,7 +650,7 @@ void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
if(context) 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 @@ void SampleCoverage(GLclampf value, GLboolean invert) ...@@ -4239,7 +4239,7 @@ void SampleCoverage(GLclampf value, GLboolean invert)
if(context) if(context)
{ {
context->setSampleCoverageParams(es2::clamp01(value), invert == GL_TRUE); context->setSampleCoverageParams(es2::clamp01(value), invert != GL_FALSE);
} }
} }
...@@ -5624,7 +5624,7 @@ void VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normal ...@@ -5624,7 +5624,7 @@ void VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normal
return error(GL_INVALID_OPERATION); 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);
} }
} }
......
...@@ -3679,7 +3679,7 @@ GL_APICALL void GL_APIENTRY glTexStorage2D(GLenum target, GLsizei levels, GLenum ...@@ -3679,7 +3679,7 @@ GL_APICALL void GL_APIENTRY glTexStorage2D(GLenum target, GLsizei levels, GLenum
} }
es2::Texture2D *texture = context->getTexture2D(target); 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); return error(GL_INVALID_OPERATION);
} }
...@@ -3754,7 +3754,7 @@ GL_APICALL void GL_APIENTRY glTexStorage3D(GLenum target, GLsizei levels, GLenum ...@@ -3754,7 +3754,7 @@ GL_APICALL void GL_APIENTRY glTexStorage3D(GLenum target, GLsizei levels, GLenum
} }
es2::Texture3D *texture = context->getTexture3D(); 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); return error(GL_INVALID_OPERATION);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment