Vulkan: Fix offset handling for vertex buffers
Bug: angleproject:2580
Change-Id: I22f62a8549e998275224a6b1f9c133cf31ebb5b9
Reviewed-on: https://chromium-review.googlesource.com/1118419
Commit-Queue: Luc Ferron <lucferron@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp b/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
index e319baf..d3bf299 100644
--- a/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
+++ b/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
@@ -244,14 +244,14 @@
BufferVk *bufferVk = vk::GetImpl(bufferGL);
mCurrentArrayBufferResources[attribIndex] = bufferVk;
mCurrentArrayBufferHandles[attribIndex] = bufferVk->getVkBuffer().getHandle();
+ mCurrentArrayBufferOffsets[attribIndex] = binding.getOffset();
}
else
{
mCurrentArrayBufferResources[attribIndex] = nullptr;
mCurrentArrayBufferHandles[attribIndex] = VK_NULL_HANDLE;
+ mCurrentArrayBufferOffsets[attribIndex] = 0;
}
- // TODO(jmadill): Offset handling. Assume zero for now.
- mCurrentArrayBufferOffsets[attribIndex] = 0;
}
else
{
@@ -351,7 +351,7 @@
vk::PackedVertexInputAttributeDesc &attribDesc = mPackedInputAttributes[attribIndex];
attribDesc.format = static_cast<uint16_t>(vkFormat);
attribDesc.location = static_cast<uint16_t>(attribIndex);
- attribDesc.offset = static_cast<uint32_t>(ComputeVertexAttributeOffset(attrib, binding));
+ attribDesc.offset = static_cast<uint32_t>(attrib.relativeOffset);
}
gl::Error VertexArrayVk::drawArrays(const gl::Context *context,