ES31: Implement Vertex Attrib Binding entry points
This patch intends to implement all entry points related to Vertex
Attrib Binding.
(1) Add entry points and validation code on following APIs:
- VertexAttribFormat
- VertexAttribIFormat
- VertexAttribBinding
- BindVertexBuffer
- VertexBindingDivisor
(2) Add queries on following parameters:
- VERTEX_ATTRIB_BINDING
- VERTEX_ATTRIB_RELATIVE_OFFSET
- VERTEX_BINDING_DIVISOR
- VERTEX_BINDING_OFFSET
- VERTEX_BINDING_STRIDE
- VERTEX_BINDING_BUFFER
BUG=angleproject:1593
TEST=angle_end2end_tests
TEST=angle_unittests
TEST=dEQP-GLES31.functional.state_query.integer.max_vertex_attrib_relative_offset_*
TEST=dEQP-GLES31.functional.state_query.integer.max_vertex_attrib_bindings_*
TEST=dEQP-GLES31.functional.state_query.integer.max_vertex_attrib_stride_*
TEST=dEQP-GLES31.functional.state_query.vertex_attribute_binding.*
TEST=dEQP-GLES31.functional.debug.negative_coverage.log.vertex_array.vertex_attrib_pointer
TEST=dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.vertex_attrib_format
TEST=dEQP-GLES31.functional.debug.negative_coverage.get_error.vertex_array.vertex_attrib_i_format
Change-Id: I4b477a82df6aad89b89b088580a06d66963e6666
Reviewed-on: https://chromium-review.googlesource.com/446124
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/VertexArray.cpp b/src/libANGLE/VertexArray.cpp
index cea141d..f831e7f 100644
--- a/src/libANGLE/VertexArray.cpp
+++ b/src/libANGLE/VertexArray.cpp
@@ -96,8 +96,8 @@
{
static_assert(gl::MAX_VERTEX_ATTRIBS == gl::MAX_VERTEX_ATTRIB_BINDINGS,
"The stride of vertex attributes should equal to that of vertex bindings.");
- ASSERT(dirtyBit > gl::VertexArray::DIRTY_BIT_ELEMENT_ARRAY_BUFFER);
- return (dirtyBit - gl::VertexArray::DIRTY_BIT_ATTRIB_0_ENABLED) % gl::MAX_VERTEX_ATTRIBS;
+ ASSERT(dirtyBit > DIRTY_BIT_ELEMENT_ARRAY_BUFFER);
+ return (dirtyBit - DIRTY_BIT_ATTRIB_0_ENABLED) % gl::MAX_VERTEX_ATTRIBS;
}
void VertexArray::bindVertexBuffer(size_t bindingIndex,
@@ -119,8 +119,7 @@
{
ASSERT(attribIndex < getMaxAttribs() && bindingIndex < getMaxBindings());
- // TODO(jiawei.shao@intel.com): Vertex Attrib Bindings
- ASSERT(attribIndex == bindingIndex);
+ mState.mVertexAttributes[attribIndex].bindingIndex = static_cast<GLuint>(bindingIndex);
mDirtyBits.set(DIRTY_BIT_ATTRIB_0_BINDING + attribIndex);
}
@@ -162,6 +161,7 @@
void VertexArray::enableAttribute(size_t attribIndex, bool enabledState)
{
ASSERT(attribIndex < getMaxAttribs());
+
mState.mVertexAttributes[attribIndex].enabled = enabledState;
mDirtyBits.set(DIRTY_BIT_ATTRIB_0_ENABLED + attribIndex);