D3D: Return error from getVertexSpaceRequired.
This removes another use of the gl::ErrorOrResult pattern. Unblocks
error refactoring.
Bug: angleproject:2738
Change-Id: Ib611a3b68f8995469befd51797dfed34eaeee84e
Reviewed-on: https://chromium-review.googlesource.com/1151450
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/VertexDataManager.cpp b/src/libANGLE/renderer/d3d/VertexDataManager.cpp
index e8b2482..9f254da 100644
--- a/src/libANGLE/renderer/d3d/VertexDataManager.cpp
+++ b/src/libANGLE/renderer/d3d/VertexDataManager.cpp
@@ -96,14 +96,11 @@
if (attrib.type != GL_FLOAT)
{
- auto errorOrElementSize = factory->getVertexSpaceRequired(context, attrib, binding, 1, 0);
- if (errorOrElementSize.isError())
- {
- ERR() << "Unlogged error in DirectStoragePossible.";
- return false;
- }
-
- alignment = std::min<size_t>(errorOrElementSize.getResult(), 4);
+ unsigned int elementSize = 0;
+ gl::Error error =
+ factory->getVertexSpaceRequired(context, attrib, binding, 1, 0, &elementSize);
+ ASSERT(!error.isError());
+ alignment = std::min<size_t>(elementSize, 4);
}
GLintptr offset = ComputeVertexAttributeOffset(attrib, binding);
@@ -355,9 +352,8 @@
unsigned int streamOffset = 0;
translated->storage = nullptr;
- ANGLE_TRY_RESULT(
- bufferD3D->getFactory()->getVertexSpaceRequired(context, attrib, binding, 1, 0),
- translated->stride);
+ ANGLE_TRY(bufferD3D->getFactory()->getVertexSpaceRequired(context, attrib, binding, 1, 0,
+ &translated->stride));
auto *staticBuffer = bufferD3D->getStaticVertexBuffer(attrib, binding);
ASSERT(staticBuffer);
@@ -539,8 +535,8 @@
unsigned int streamOffset = 0;
translated->storage = nullptr;
- ANGLE_TRY_RESULT(mFactory->getVertexSpaceRequired(context, attrib, binding, 1, 0),
- translated->stride);
+ ANGLE_TRY(
+ mFactory->getVertexSpaceRequired(context, attrib, binding, 1, 0, &translated->stride));
size_t totalCount = gl::ComputeVertexBindingElementCount(binding.getDivisor(), count,
static_cast<size_t>(instances));