Commit 7e50f4cd by James Dong Committed by Commit Bot

Vulkan: Fix ES 3.1 vertex attribute bindings

When handling dirty bindings, we were treating binding indices as if they were attribute indices, causing strange behavior. This change fixes the dirty bit handler to use the provided index properly and update the attributes that correspond to the binding index. Test: ./angle_end2end_tests --gtest_filter='VertexAttributeTestES31.OnlyUpdate*/ES3_1_Vulkan' Bug: angleproject:3598 Change-Id: I2bc3cd4da5f639a1301776fcf057a74368812c56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1718786 Commit-Queue: James Dong <dongja@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 6e909862
......@@ -372,11 +372,14 @@ angle::Result VertexArrayVk::syncState(const gl::Context *context,
ANGLE_VERTEX_INDEX_CASES(ANGLE_VERTEX_DIRTY_ATTRIB_FUNC)
#define ANGLE_VERTEX_DIRTY_BINDING_FUNC(INDEX) \
case gl::VertexArray::DIRTY_BIT_BINDING_0 + INDEX: \
ANGLE_TRY(syncDirtyAttrib(contextVk, attribs[INDEX], \
bindings[attribs[INDEX].bindingIndex], INDEX)); \
(*bindingBits)[INDEX].reset(); \
#define ANGLE_VERTEX_DIRTY_BINDING_FUNC(INDEX) \
case gl::VertexArray::DIRTY_BIT_BINDING_0 + INDEX: \
for (size_t attribIndex : bindings[INDEX].getBoundAttributesMask()) \
{ \
ANGLE_TRY( \
syncDirtyAttrib(contextVk, attribs[attribIndex], bindings[INDEX], attribIndex)); \
} \
(*bindingBits)[INDEX].reset(); \
break;
ANGLE_VERTEX_INDEX_CASES(ANGLE_VERTEX_DIRTY_BINDING_FUNC)
......
......@@ -1449,8 +1449,6 @@ TEST_P(VertexAttributeTestES31, ChangeAttribFormatAfterVertexAttribPointer)
// Verify that only updating a binding without updating the bound format won't mess up this draw.
TEST_P(VertexAttributeTestES31, OnlyUpdateBindingByBindVertexBuffer)
{
ANGLE_SKIP_TEST_IF(IsVulkan()); // anglebug.com/3598 - vertex attrib binding
// Default binding index for test
constexpr GLint kTestBinding = 10;
initOnlyUpdateBindingTest(kTestBinding);
......@@ -1488,8 +1486,6 @@ TEST_P(VertexAttributeTestES31, OnlyUpdateBindingByBindVertexBuffer)
// Verify that only updating a binding without updating the bound format won't mess up this draw.
TEST_P(VertexAttributeTestES31, OnlyUpdateBindingByVertexAttribPointer)
{
ANGLE_SKIP_TEST_IF(IsVulkan()); // anglebug.com/3598 - vertex attrib binding
// Default binding index for test
constexpr GLint kTestBinding = 10;
initOnlyUpdateBindingTest(kTestBinding);
......
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