Commit 204720bd by shrekshao Committed by Commit Bot

Fix GetBooleani_v validation and params length for WebGL OES_draw_buffers_indexed

WebGL 2 seems to be ES300 context and will fail the ValidateGetBooleani_v at context->getClientVersion() >= ES_3_1. Also for getIndexedParameter pname==GL_COLOR_WRITEMASK, the length shall be 4. Bug: angleproject:4394, chromium:1058744 Change-Id: Ia60506b6b1f120ed06acbcea0cb1f4581c70b32b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2191424Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
parent a2ece533
...@@ -85,6 +85,7 @@ MSG kDestinationTextureTooSmall = "Destination texture too small."; ...@@ -85,6 +85,7 @@ MSG kDestinationTextureTooSmall = "Destination texture too small.";
MSG kDimensionsMustBePow2 = "Texture dimensions must be power-of-two."; MSG kDimensionsMustBePow2 = "Texture dimensions must be power-of-two.";
MSG kDispatchIndirectBufferNotBound = "Dispatch indirect buffer must be bound."; MSG kDispatchIndirectBufferNotBound = "Dispatch indirect buffer must be bound.";
MSG kDrawBufferMaskMismatch = "Active draw buffers with missing fragment shader outputs."; MSG kDrawBufferMaskMismatch = "Active draw buffers with missing fragment shader outputs.";
MSG kES31OrDrawBuffersIndexedExtensionNotAvailable = "EXT/OES_draw_buffers_indexed or ES 3.1 are required but not available.";
MSG kDrawBufferTypeMismatch = "Fragment shader output type does not match the bound framebuffer attachment type."; MSG kDrawBufferTypeMismatch = "Fragment shader output type does not match the bound framebuffer attachment type.";
MSG kDrawFramebufferIncomplete = "Draw framebuffer is incomplete"; MSG kDrawFramebufferIncomplete = "Draw framebuffer is incomplete";
MSG kDrawIndirectBufferNotBound = "Draw indirect buffer must be bound."; MSG kDrawIndirectBufferNotBound = "Draw indirect buffer must be bound.";
......
...@@ -2808,7 +2808,14 @@ bool ValidateIndexedStateQuery(const Context *context, GLenum pname, GLuint inde ...@@ -2808,7 +2808,14 @@ bool ValidateIndexedStateQuery(const Context *context, GLenum pname, GLuint inde
if (length) if (length)
{ {
*length = 1; if (pname == GL_COLOR_WRITEMASK)
{
*length = 4;
}
else
{
*length = 1;
}
} }
return true; return true;
......
...@@ -370,9 +370,10 @@ bool ValidateGetBooleani_v(const Context *context, ...@@ -370,9 +370,10 @@ bool ValidateGetBooleani_v(const Context *context,
GLuint index, GLuint index,
const GLboolean *data) const GLboolean *data)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1 && !context->getExtensions().drawBuffersIndexedAny())
{ {
context->validationError(GL_INVALID_OPERATION, kES31Required); context->validationError(GL_INVALID_OPERATION,
kES31OrDrawBuffersIndexedExtensionNotAvailable);
return false; return false;
} }
...@@ -391,9 +392,10 @@ bool ValidateGetBooleani_vRobustANGLE(const Context *context, ...@@ -391,9 +392,10 @@ bool ValidateGetBooleani_vRobustANGLE(const Context *context,
const GLsizei *length, const GLsizei *length,
const GLboolean *data) const GLboolean *data)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1 && !context->getExtensions().drawBuffersIndexedAny())
{ {
context->validationError(GL_INVALID_OPERATION, kES31Required); context->validationError(GL_INVALID_OPERATION,
kES31OrDrawBuffersIndexedExtensionNotAvailable);
return false; return false;
} }
......
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