Commit fa5d84be by Luc Ferron Committed by Commit Bot

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: 's avatarGeoff Lang <geofflang@chromium.org>
parent 475ef575
......@@ -244,14 +244,14 @@ void VertexArrayVk::syncDirtyAttrib(const gl::VertexAttribute &attrib,
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 @@ void VertexArrayVk::updatePackedInputInfo(const RendererVk *rendererVk,
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,
......
......@@ -222,21 +222,30 @@ TEST_P(IndexedPointsTestUByte, UnsignedByteOffset3)
TEST_P(IndexedPointsTestUByte, VertexWithColorUnsignedByteOffset0)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
runTest(0, true);
}
TEST_P(IndexedPointsTestUByte, VertexWithColorUnsignedByteOffset1)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
runTest(1, true);
}
TEST_P(IndexedPointsTestUByte, VertexWithColorUnsignedByteOffset2)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
runTest(2, true);
}
TEST_P(IndexedPointsTestUByte, VertexWithColorUnsignedByteOffset3)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
runTest(3, true);
}
......@@ -264,26 +273,37 @@ TEST_P(IndexedPointsTestUShort, UnsignedShortOffset3)
TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffset0)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
runTest(0, true);
}
TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffset1)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
runTest(1, true);
}
TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffset2)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
runTest(2, true);
}
TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffset3)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
runTest(3, true);
}
TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffsetChangingIndices)
{
// TODO(fjhenigman): Fix with buffer offset http://anglebug.com/2401
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAMD());
// TODO(fjhenigman): Figure out why this fails on Ozone Intel.
ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel() && IsOpenGLES());
......
......@@ -402,9 +402,6 @@ TEST_P(SimpleOperationTest, DrawLine)
// Simple line test that will use a very large offset in the vertex attributes.
TEST_P(SimpleOperationTest, DrawLineWithLargeAttribPointerOffset)
{
// TODO(lucferron): This test fails for the same reason as http://anglebug.com/2580
ANGLE_SKIP_TEST_IF(IsVulkan());
// We assume in the test the width and height are equal and we are tracing
// the line from bottom left to top right. Verify that all pixels along that line
// have been traced with green.
......
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