Commit 8c379f36 by Frank Henigman Committed by Commit Bot

Vulkan: enable some vertex data tests.

Enable tests that don't use fixed or unnormalized short/byte vertex data, with some exceptions for Android and AMD. BUG=angleproject:2405 Change-Id: I9e37ebca3a873617f11fee065b7a0ba67f80998c Reviewed-on: https://chromium-review.googlesource.com/1111317 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org>
parent 5ba37427
...@@ -88,13 +88,6 @@ gl::Error VertexArrayVk::streamVertexData(RendererVk *renderer, ...@@ -88,13 +88,6 @@ gl::Error VertexArrayVk::streamVertexData(RendererVk *renderer,
const gl::VertexBinding &binding = bindings[attrib.bindingIndex]; const gl::VertexBinding &binding = bindings[attrib.bindingIndex];
ASSERT(attrib.enabled && binding.getBuffer().get() == nullptr); ASSERT(attrib.enabled && binding.getBuffer().get() == nullptr);
// TODO(fjhenigman): Work with more formats than just GL_FLOAT.
if (attrib.type != GL_FLOAT)
{
UNIMPLEMENTED();
return gl::InternalError();
}
// Only [firstVertex, lastVertex] is needed by the upcoming draw so that // Only [firstVertex, lastVertex] is needed by the upcoming draw so that
// is all we copy, but we allocate space for [0, lastVertex] so indexing // is all we copy, but we allocate space for [0, lastVertex] so indexing
// will work. If we don't start at zero all the indices will be off. // will work. If we don't start at zero all the indices will be off.
...@@ -349,6 +342,11 @@ void VertexArrayVk::updatePackedInputInfo(const RendererVk *rendererVk, ...@@ -349,6 +342,11 @@ void VertexArrayVk::updatePackedInputInfo(const RendererVk *rendererVk,
VkFormat vkFormat = rendererVk->getFormat(GetVertexFormatID(attrib)).vkBufferFormat; VkFormat vkFormat = rendererVk->getFormat(GetVertexFormatID(attrib)).vkBufferFormat;
ASSERT(vkFormat <= std::numeric_limits<uint16_t>::max()); ASSERT(vkFormat <= std::numeric_limits<uint16_t>::max());
if (vkFormat == VK_FORMAT_UNDEFINED)
{
// TODO(fjhenigman): Add support for vertex data format. anglebug.com/2405
UNIMPLEMENTED();
}
vk::PackedVertexInputAttributeDesc &attribDesc = mPackedInputAttributes[attribIndex]; vk::PackedVertexInputAttributeDesc &attribDesc = mPackedInputAttributes[attribIndex];
attribDesc.format = static_cast<uint16_t>(vkFormat); attribDesc.format = static_cast<uint16_t>(vkFormat);
......
...@@ -296,7 +296,7 @@ class AttributeLayoutTest : public ANGLETest ...@@ -296,7 +296,7 @@ class AttributeLayoutTest : public ANGLETest
for (unsigned i = 0; i < mTestCases.size(); ++i) for (unsigned i = 0; i < mTestCases.size(); ++i)
{ {
if (Skip(mTestCases[i])) if (mTestCases[i].size() == 0 || Skip(mTestCases[i]))
continue; continue;
PrepareTestCase(mTestCases[i]); PrepareTestCase(mTestCases[i]);
...@@ -388,29 +388,44 @@ void AttributeLayoutTest::GetTestCases(void) ...@@ -388,29 +388,44 @@ void AttributeLayoutTest::GetTestCases(void)
// 5. stride != size // 5. stride != size
mTestCases.push_back({Float(B0, 0, 16, mCoord), Float(B1, 0, 12, mColor)}); mTestCases.push_back({Float(B0, 0, 16, mCoord), Float(B1, 0, 12, mColor)});
// 6-7. normalized byte/short
if (IsVulkan() && (IsAndroid() || (IsWindows() && IsAMD())))
{
// empty test cases preserve the numbering
mTestCases.push_back({});
mTestCases.push_back({});
}
else
{
// TODO(fjhenigman): Enable these once vertex format conversion is implemented.
// anglebug.com/2405
mTestCases.push_back({NormSByte(M0, 0, 8, mCoord), NormUByte(M0, 4, 8, mColor)});
mTestCases.push_back({NormSShort(M0, 0, 20, mCoord), NormUShort(M0, 8, 20, 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: fixed or non-normalized byte/short data, non-zero "
"buffer offsets"
<< std::endl;
return; return;
} }
// 6. one buffer, sequential // 8. one buffer, sequential
mTestCases.push_back({Float(B0, 0, 8, mCoord), Float(B0, 96, 12, mColor)}); mTestCases.push_back({Float(B0, 0, 8, mCoord), Float(B0, 96, 12, mColor)});
// 7. one buffer, interleaved // 9. one buffer, interleaved
mTestCases.push_back({Float(B0, 0, 20, mCoord), Float(B0, 8, 20, mColor)}); mTestCases.push_back({Float(B0, 0, 20, mCoord), Float(B0, 8, 20, mColor)});
// 8. memory and buffer, float and integer // 10. memory and buffer, float and integer
mTestCases.push_back({Float(M0, 0, 8, mCoord), SByte(B0, 0, 12, mColor)}); mTestCases.push_back({Float(M0, 0, 8, mCoord), SByte(B0, 0, 12, mColor)});
// 9. buffer and memory, unusual offset and stride // 11. buffer and memory, unusual offset and stride
mTestCases.push_back({Float(B0, 11, 13, mCoord), Float(M0, 23, 17, mColor)}); mTestCases.push_back({Float(B0, 11, 13, mCoord), Float(M0, 23, 17, mColor)});
// 10-13. remaining ES2 types // 12-13. unnormalized
mTestCases.push_back({Fixed(M0, 0, 20, mCoord), UByte(M0, 16, 20, mColor)}); mTestCases.push_back({Fixed(M0, 0, 20, mCoord), UByte(M0, 16, 20, mColor)});
mTestCases.push_back({SShort(M0, 0, 20, mCoord), UShort(M0, 8, 20, mColor)}); mTestCases.push_back({SShort(M0, 0, 20, mCoord), UShort(M0, 8, 20, mColor)});
mTestCases.push_back({NormSByte(M0, 0, 8, mCoord), NormUByte(M0, 4, 8, mColor)});
mTestCases.push_back({NormSShort(M0, 0, 20, mCoord), NormUShort(M0, 8, 20, mColor)});
// 14-15. remaining ES3 types // 14-15. remaining ES3 types
if (es3) if (es3)
......
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