Move client attribs mask to front-end.
The Vulkan and GL back-ends both had a client attributes mask.
This consolidates them into the front-end, where it can also
be used in the validation layer.
Also includes a fix which was incorrectly setting the enabled
mask in setVertexAttribFormatImpl.
Bug: angleproject:1391
Change-Id: I5e45c1e2a56b30a36dec1482d170592c30a16d40
Reviewed-on: https://chromium-review.googlesource.com/1008272
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Luc Ferron <lucferron@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp b/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
index 5b34f65..24efd58 100644
--- a/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
+++ b/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
@@ -70,8 +70,8 @@
{
ASSERT(!attribsToStream.none());
- const auto &attribs = mState.getVertexAttributes();
- const auto &bindings = mState.getVertexBindings();
+ const auto &attribs = mState.getVertexAttributes();
+ const auto &bindings = mState.getVertexBindings();
const size_t lastVertex = drawCallParams.firstVertex() + drawCallParams.vertexCount();
@@ -243,20 +243,17 @@
BufferVk *bufferVk = vk::GetImpl(bufferGL);
mCurrentArrayBufferResources[attribIndex] = bufferVk;
mCurrentArrayBufferHandles[attribIndex] = bufferVk->getVkBuffer().getHandle();
- mClientMemoryAttribs.reset(attribIndex);
}
else
{
mCurrentArrayBufferResources[attribIndex] = nullptr;
mCurrentArrayBufferHandles[attribIndex] = VK_NULL_HANDLE;
- mClientMemoryAttribs.set(attribIndex);
}
// TODO(jmadill): Offset handling. Assume zero for now.
mCurrentArrayBufferOffsets[attribIndex] = 0;
}
else
{
- mClientMemoryAttribs.reset(attribIndex);
UNIMPLEMENTED();
}
}
@@ -439,12 +436,13 @@
{
const gl::State &state = context->getGLState();
const gl::Program *programGL = state.getProgram();
+ const gl::AttributesMask &clientAttribs = mState.getEnabledClientMemoryAttribsMask();
const gl::AttributesMask &activeAttribs = programGL->getActiveAttribLocationsMask();
uint32_t maxAttrib = programGL->getState().getMaxActiveAttribLocation();
- if (mClientMemoryAttribs.any())
+ if (clientAttribs.any())
{
- const gl::AttributesMask &attribsToStream = (mClientMemoryAttribs & activeAttribs);
+ const gl::AttributesMask &attribsToStream = (clientAttribs & activeAttribs);
if (attribsToStream.any())
{
ANGLE_TRY(drawCallParams.ensureIndexRangeResolved(context));