Commit 58f67be0 by jchen10 Committed by Commit Bot

ES31 program query: support AtomicCounterBuffer and UniformBlock

Calculates atomic counter buffer's shader reference according to its child counters. Merges GL_UNIFORM_BLOCK_* queries to GL_*. Refreshes deqp_gles31_test_expectations. BUG=angleproject:1920 TEST=angle_end2end_tests:ProgramInterfaceTest* dEQP-GLES31.functional.state_query.program.active_atomic_counter_buffers_get_programiv dEQP-GLES31.functional.layout_binding.ubo.* Change-Id: Ia23ddfef5f5dd7e15628f4c259273e1c01c14d80 Reviewed-on: https://chromium-review.googlesource.com/715436 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent a8b73ed0
......@@ -1659,6 +1659,11 @@ GLuint Program::getActiveUniformBlockCount() const
return static_cast<GLuint>(mState.mUniformBlocks.size());
}
GLuint Program::getActiveAtomicCounterBufferCount() const
{
return static_cast<GLuint>(mState.mAtomicCounterBuffers.size());
}
GLuint Program::getActiveShaderStorageBlockCount() const
{
return static_cast<GLuint>(mState.mShaderStorageBlocks.size());
......@@ -2006,6 +2011,7 @@ bool Program::linkAtomicCounterBuffers()
buffer.memberIndexes.push_back(index);
uniform.bufferIndex = bufferIndex;
found = true;
buffer.unionReferencesWith(uniform);
break;
}
}
......@@ -2014,6 +2020,7 @@ bool Program::linkAtomicCounterBuffers()
AtomicCounterBuffer atomicCounterBuffer;
atomicCounterBuffer.binding = uniform.binding;
atomicCounterBuffer.memberIndexes.push_back(index);
atomicCounterBuffer.unionReferencesWith(uniform);
mState.mAtomicCounterBuffers.push_back(atomicCounterBuffer);
uniform.bufferIndex = static_cast<int>(mState.mAtomicCounterBuffers.size() - 1);
}
......
......@@ -496,6 +496,7 @@ class Program final : angle::NonCopyable, public LabeledObject
void getActiveUniformBlockName(GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName) const;
GLuint getActiveUniformBlockCount() const;
GLuint getActiveAtomicCounterBufferCount() const;
GLuint getActiveShaderStorageBlockCount() const;
GLint getActiveUniformBlockMaxLength() const;
......
......@@ -46,7 +46,7 @@ void StaticallyUsed::setStaticUse(GLenum shaderType, bool used)
}
}
void StaticallyUsed::unionWith(const StaticallyUsed &other)
void StaticallyUsed::unionReferencesWith(const StaticallyUsed &other)
{
vertexStaticUse |= other.vertexStaticUse;
fragmentStaticUse |= other.fragmentStaticUse;
......
......@@ -29,7 +29,7 @@ struct StaticallyUsed
StaticallyUsed &operator=(const StaticallyUsed &rhs);
void setStaticUse(GLenum shaderType, bool used);
void unionWith(const StaticallyUsed &other);
void unionReferencesWith(const StaticallyUsed &other);
bool vertexStaticUse;
bool fragmentStaticUse;
......
......@@ -4153,6 +4153,7 @@ bool ValidateGetProgramivBase(ValidationContext *context,
case GL_PROGRAM_SEPARABLE:
case GL_COMPUTE_WORK_GROUP_SIZE:
case GL_ACTIVE_ATOMIC_COUNTER_BUFFERS:
if (context->getClientVersion() < Version(3, 1))
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(), ES31Required);
......
......@@ -260,12 +260,16 @@ bool ValidateProgramResourceIndex(const Program *programObject,
case GL_UNIFORM:
return (index < static_cast<GLuint>(programObject->getActiveUniformCount()));
// TODO(jie.a.chen@intel.com): more interfaces.
case GL_UNIFORM_BLOCK:
return (index < programObject->getActiveUniformBlockCount());
case GL_ATOMIC_COUNTER_BUFFER:
return (index < programObject->getActiveAtomicCounterBufferCount());
// TODO(jie.a.chen@intel.com): more interfaces.
case GL_TRANSFORM_FEEDBACK_VARYING:
case GL_BUFFER_VARIABLE:
case GL_SHADER_STORAGE_BLOCK:
case GL_ATOMIC_COUNTER_BUFFER:
UNIMPLEMENTED();
return false;
......
......@@ -28,6 +28,8 @@
1659 NVIDIA OPENGL : dEQP-GLES31.functional.draw_indirect.random.10 = SKIP
1659 NVIDIA OPENGL : dEQP-GLES31.functional.draw_indirect.random.15 = SKIP
1659 NVIDIA OPENGL : dEQP-GLES31.functional.draw_indirect.random.18 = SKIP
1920 NVIDIA OPENGL : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_array = SKIP
1920 NVIDIA D3D11 : dEQP-GLES31.functional.layout_binding.ubo.vertex_binding_max = SKIP
1442 OPENGL D3D11 : dEQP-GLES31.functional.program_interface_query.transform_feedback_varying.resource_list.vertex_fragment.builtin_gl_position = SKIP
1442 OPENGL D3D11 : dEQP-GLES31.functional.program_interface_query.transform_feedback_varying.resource_list.vertex_fragment.default_block_struct_member = SKIP
1442 OPENGL D3D11 : dEQP-GLES31.functional.program_interface_query.transform_feedback_varying.array_size.vertex_fragment.default_block_struct_member = SKIP
......@@ -80,6 +82,8 @@
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_3 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_9 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_10 = SKIP
1442 D3D11 : dEQP-GLES31.functional.state_query.program.active_atomic_counter_buffers_get_programiv = FAIL
1442 D3D11 : dEQP-GLES31.functional.layout_binding.ubo.* = FAIL
// OPENGL Failing Tests
1665 WIN NVIDIA OPENGL : dEQP-GLES31.functional.draw_indirect.negative.command_offset_not_in_buffer_unsigned32_wrap = FAIL
......@@ -1254,7 +1258,6 @@
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.internal_format.partial_query.num_sample_counts = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.internal_format.partial_query.samples = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.program.program_separable_get_programiv = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.program.active_atomic_counter_buffers_get_programiv = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.state_query.program_pipeline.* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.synchronization.* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.geometry_shading.query.geometry_linked_vertices_out = FAIL
......@@ -1305,7 +1308,6 @@
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.shader_directive.tessellation_shader = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.debug.object_labels.program_pipeline = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.program_interface_query.* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.layout_binding.ubo.* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.layout_binding.ssbo.* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.layout_binding.image.image2d.* = FAIL
1442 OPENGL D3D11 : dEQP-GLES31.functional.layout_binding.image.image3d.* = 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