Commit 9c8e1a36 by Xinghua Cao Committed by Commit Bot

ES31: Implement image state query

BUG=angleproject:2278 TEST=dEQP-GLES31.functional.state_query.indexed.image_binding* Change-Id: Ia624d55ccf1fdf92188d9e710265bdffe96a23c6 Reviewed-on: https://chromium-review.googlesource.com/810465 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 195be942
...@@ -786,6 +786,12 @@ bool ValidationContext::getIndexedQueryParameterInfo(GLenum target, ...@@ -786,6 +786,12 @@ bool ValidationContext::getIndexedQueryParameterInfo(GLenum target,
switch (target) switch (target)
{ {
case GL_IMAGE_BINDING_LAYERED:
{
*type = GL_BOOL;
*numParams = 1;
return true;
}
case GL_MAX_COMPUTE_WORK_GROUP_COUNT: case GL_MAX_COMPUTE_WORK_GROUP_COUNT:
case GL_MAX_COMPUTE_WORK_GROUP_SIZE: case GL_MAX_COMPUTE_WORK_GROUP_SIZE:
case GL_ATOMIC_COUNTER_BUFFER_BINDING: case GL_ATOMIC_COUNTER_BUFFER_BINDING:
...@@ -795,6 +801,11 @@ bool ValidationContext::getIndexedQueryParameterInfo(GLenum target, ...@@ -795,6 +801,11 @@ bool ValidationContext::getIndexedQueryParameterInfo(GLenum target,
case GL_VERTEX_BINDING_OFFSET: case GL_VERTEX_BINDING_OFFSET:
case GL_VERTEX_BINDING_STRIDE: case GL_VERTEX_BINDING_STRIDE:
case GL_SAMPLE_MASK_VALUE: case GL_SAMPLE_MASK_VALUE:
case GL_IMAGE_BINDING_NAME:
case GL_IMAGE_BINDING_LEVEL:
case GL_IMAGE_BINDING_LAYER:
case GL_IMAGE_BINDING_ACCESS:
case GL_IMAGE_BINDING_FORMAT:
{ {
*type = GL_INT; *type = GL_INT;
*numParams = 1; *numParams = 1;
......
...@@ -72,6 +72,8 @@ ERRMSG(InvalidFormat, "Invalid format."); ...@@ -72,6 +72,8 @@ ERRMSG(InvalidFormat, "Invalid format.");
ERRMSG(InvalidFramebufferTarget, "Invalid framebuffer target."); ERRMSG(InvalidFramebufferTarget, "Invalid framebuffer target.");
ERRMSG(InvalidFramebufferTextureLevel, "Mipmap level must be 0 when attaching a texture."); ERRMSG(InvalidFramebufferTextureLevel, "Mipmap level must be 0 when attaching a texture.");
ERRMSG(InvalidFramebufferAttachmentParameter, "Invalid parameter name for framebuffer attachment."); ERRMSG(InvalidFramebufferAttachmentParameter, "Invalid parameter name for framebuffer attachment.");
ERRMSG(InvalidImageUnit,
"Image unit cannot be greater than or equal to the value of MAX_IMAGE_UNITS.");
ERRMSG(InvalidInternalFormat, "Invalid internal format."); ERRMSG(InvalidInternalFormat, "Invalid internal format.");
ERRMSG(InvalidMatrixMode, "Invalid matrix mode."); ERRMSG(InvalidMatrixMode, "Invalid matrix mode.");
ERRMSG(InvalidMipLevel, "Level of detail outside of range."); ERRMSG(InvalidMipLevel, "Level of detail outside of range.");
......
...@@ -2116,6 +2116,26 @@ void State::getIntegeri_v(GLenum target, GLuint index, GLint *data) ...@@ -2116,6 +2116,26 @@ void State::getIntegeri_v(GLenum target, GLuint index, GLint *data)
ASSERT(static_cast<size_t>(index) < mSampleMaskValues.size()); ASSERT(static_cast<size_t>(index) < mSampleMaskValues.size());
*data = mSampleMaskValues[index]; *data = mSampleMaskValues[index];
break; break;
case GL_IMAGE_BINDING_NAME:
ASSERT(static_cast<size_t>(index) < mImageUnits.size());
*data = mImageUnits[index].texture.id();
break;
case GL_IMAGE_BINDING_LEVEL:
ASSERT(static_cast<size_t>(index) < mImageUnits.size());
*data = mImageUnits[index].level;
break;
case GL_IMAGE_BINDING_LAYER:
ASSERT(static_cast<size_t>(index) < mImageUnits.size());
*data = mImageUnits[index].layer;
break;
case GL_IMAGE_BINDING_ACCESS:
ASSERT(static_cast<size_t>(index) < mImageUnits.size());
*data = mImageUnits[index].access;
break;
case GL_IMAGE_BINDING_FORMAT:
ASSERT(static_cast<size_t>(index) < mImageUnits.size());
*data = mImageUnits[index].format;
break;
default: default:
UNREACHABLE(); UNREACHABLE();
break; break;
...@@ -2166,7 +2186,16 @@ void State::getInteger64i_v(GLenum target, GLuint index, GLint64 *data) ...@@ -2166,7 +2186,16 @@ void State::getInteger64i_v(GLenum target, GLuint index, GLint64 *data)
void State::getBooleani_v(GLenum target, GLuint index, GLboolean *data) void State::getBooleani_v(GLenum target, GLuint index, GLboolean *data)
{ {
UNREACHABLE(); switch (target)
{
case GL_IMAGE_BINDING_LAYERED:
ASSERT(static_cast<size_t>(index) < mImageUnits.size());
*data = mImageUnits[index].layered;
break;
default:
UNREACHABLE();
break;
}
} }
bool State::hasMappedBuffer(BufferBinding target) const bool State::hasMappedBuffer(BufferBinding target) const
......
...@@ -2358,6 +2358,23 @@ bool ValidateIndexedStateQuery(ValidationContext *context, ...@@ -2358,6 +2358,23 @@ bool ValidateIndexedStateQuery(ValidationContext *context,
return false; return false;
} }
break; break;
case GL_IMAGE_BINDING_NAME:
case GL_IMAGE_BINDING_LEVEL:
case GL_IMAGE_BINDING_LAYERED:
case GL_IMAGE_BINDING_LAYER:
case GL_IMAGE_BINDING_ACCESS:
case GL_IMAGE_BINDING_FORMAT:
if (context->getClientVersion() < ES_3_1)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumRequiresGLES31);
return false;
}
if (index >= caps.maxImageUnits)
{
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidImageUnit);
return false;
}
break;
default: default:
context->handleError(InvalidEnum()); context->handleError(InvalidEnum());
return false; return false;
......
...@@ -1184,7 +1184,6 @@ ...@@ -1184,7 +1184,6 @@
1442 OPENGL D3D11 : dEQP-GLES31.functional.stencil_texturing.misc.compare_mode_effect = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.stencil_texturing.misc.compare_mode_effect = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.stencil_texturing.misc.base_level = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.stencil_texturing.misc.base_level = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.integer.program_pipeline_binding_* = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.integer.program_pipeline_binding_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.indexed.image_binding* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.texture.texture_2d.depth_stencil_mode_* = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.texture.texture_2d.depth_stencil_mode_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.texture.texture_cube_map.depth_stencil_mode_* = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.texture.texture_cube_map.depth_stencil_mode_* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.texture.texture_2d_array.depth_stencil_mode_* = FAIL 1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.texture.texture_2d_array.depth_stencil_mode_* = FAIL
......
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