Refactor internal format pixel math methods.
This removes the use of the ErrorOrResult class from these methods.
This will enable more performant Error handling. Also cleans up the
ANGLE_TRY_CHECKED_MATH macro to be more general.
Bug: angleproject:2713
Change-Id: I349947d320907839ca88ec1f9251e6ddc3858a08
Reviewed-on: https://chromium-review.googlesource.com/1128920
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/TextureVk.cpp b/src/libANGLE/renderer/vulkan/TextureVk.cpp
index dadd0a9..e3269c0 100644
--- a/src/libANGLE/renderer/vulkan/TextureVk.cpp
+++ b/src/libANGLE/renderer/vulkan/TextureVk.cpp
@@ -101,22 +101,19 @@
const uint8_t *pixels)
{
GLuint inputRowPitch = 0;
- ANGLE_TRY_RESULT(
- formatInfo.computeRowPitch(type, extents.width, unpack.alignment, unpack.rowLength),
- inputRowPitch);
+ ANGLE_TRY_CHECKED_MATH(formatInfo.computeRowPitch(type, extents.width, unpack.alignment,
+ unpack.rowLength, &inputRowPitch));
GLuint inputDepthPitch = 0;
- ANGLE_TRY_RESULT(
- formatInfo.computeDepthPitch(extents.height, unpack.imageHeight, inputRowPitch),
- inputDepthPitch);
+ ANGLE_TRY_CHECKED_MATH(formatInfo.computeDepthPitch(extents.height, unpack.imageHeight,
+ inputRowPitch, &inputDepthPitch));
// TODO(jmadill): skip images for 3D Textures.
bool applySkipImages = false;
GLuint inputSkipBytes = 0;
- ANGLE_TRY_RESULT(
- formatInfo.computeSkipBytes(type, inputRowPitch, inputDepthPitch, unpack, applySkipImages),
- inputSkipBytes);
+ ANGLE_TRY_CHECKED_MATH(formatInfo.computeSkipBytes(type, inputRowPitch, inputDepthPitch, unpack,
+ applySkipImages, &inputSkipBytes));
RendererVk *renderer = contextVk->getRenderer();