Commit a8e868f2 by Frank Henigman Committed by Commit Bot

Vulkan: use correct vertex stride.

It was passing the attribute size, not the stride, so it worked only when they were the same. Enable corresponding tests. BUG=angleproject:2310 Change-Id: Ie3ab13567c16c302aa9aeda5d059e5fd4eb92b4e Reviewed-on: https://chromium-review.googlesource.com/875304 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 640fa5dc
...@@ -225,7 +225,7 @@ void VertexArrayVk::updatePackedInputInfo(uint32_t attribIndex, ...@@ -225,7 +225,7 @@ void VertexArrayVk::updatePackedInputInfo(uint32_t attribIndex,
size_t attribSize = gl::ComputeVertexAttributeTypeSize(attrib); size_t attribSize = gl::ComputeVertexAttributeTypeSize(attrib);
ASSERT(attribSize <= std::numeric_limits<uint16_t>::max()); ASSERT(attribSize <= std::numeric_limits<uint16_t>::max());
bindingDesc.stride = static_cast<uint16_t>(attribSize); bindingDesc.stride = static_cast<uint16_t>(binding.getStride());
bindingDesc.inputRate = static_cast<uint16_t>( bindingDesc.inputRate = static_cast<uint16_t>(
binding.getDivisor() > 0 ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX); binding.getDivisor() > 0 ? VK_VERTEX_INPUT_RATE_INSTANCE : VK_VERTEX_INPUT_RATE_VERTEX);
......
...@@ -353,21 +353,21 @@ void AttributeLayoutTest::GetTestCases(void) ...@@ -353,21 +353,21 @@ void AttributeLayoutTest::GetTestCases(void)
// 2. one memory, sequential // 2. one memory, sequential
mTestCases.push_back({Attrib(M0, 0, 8, mCoord), Attrib(M0, 96, 12, mColor)}); mTestCases.push_back({Attrib(M0, 0, 8, mCoord), Attrib(M0, 96, 12, mColor)});
// 3. buffer and memory // 3. one memory, interleaved
mTestCases.push_back({Attrib(M0, 0, 20, mCoord), Attrib(M0, 8, 20, mColor)});
// 4. buffer and memory
mTestCases.push_back({Attrib(B0, 0, 8, mCoord), Attrib(M0, 0, 12, mColor)}); mTestCases.push_back({Attrib(B0, 0, 8, mCoord), Attrib(M0, 0, 12, mColor)});
// 5. stride != size
mTestCases.push_back({Attrib(B0, 0, 16, mCoord), Attrib(B1, 0, 12, mColor)});
if (IsVulkan()) if (IsVulkan())
{ {
std::cout << "cases skipped on Vulkan: integer data, non-zero buffer offsets" << std::endl; std::cout << "cases skipped on Vulkan: integer data, non-zero buffer offsets" << std::endl;
return; return;
} }
// 4. stride != size - ANGLE bug 2310
mTestCases.push_back({Attrib(B0, 0, 16, mCoord), Attrib(B1, 0, 12, mColor)});
// 5. one memory, interleaved
mTestCases.push_back({Attrib(M0, 0, 20, mCoord), Attrib(M0, 8, 20, mColor)});
// 6. one buffer, sequential // 6. one buffer, sequential
mTestCases.push_back({Attrib(B0, 0, 8, mCoord), Attrib(B0, 96, 12, mColor)}); mTestCases.push_back({Attrib(B0, 0, 8, mCoord), Attrib(B0, 96, 12, mColor)});
......
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