Validate blitFramebuffer for overflows on all platforms
We can validate to avoid triggering driver issues even if the native
GLES spec is not telling us to.
This will fix WebGL in Chromium when it's being run with the
--use-cmd-decoder=validating --use-angle=gl config.
BUG=chromium:830046
TEST=WebGL conformance tests
Change-Id: I2d61182cb6cbe46b52e1d9b7ed6b4035defee082
Reviewed-on: https://chromium-review.googlesource.com/1033743
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 172d2aa..9d4ea71 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -1294,14 +1294,13 @@
return false;
}
- if (context->getExtensions().webglCompatibility)
+ // This validation is specified in the WebGL 2.0 spec and not in the GLES 3.0.5 spec, but we
+ // always run it in order to avoid triggering driver bugs.
+ if (DifferenceCanOverflow(srcX0, srcX1) || DifferenceCanOverflow(srcY0, srcY1) ||
+ DifferenceCanOverflow(dstX0, dstX1) || DifferenceCanOverflow(dstY0, dstY1))
{
- if (DifferenceCanOverflow(srcX0, srcX1) || DifferenceCanOverflow(srcY0, srcY1) ||
- DifferenceCanOverflow(dstX0, dstX1) || DifferenceCanOverflow(dstY0, dstY1))
- {
- ANGLE_VALIDATION_ERR(context, InvalidValue(), BlitDimensionsOutOfRange);
- return false;
- }
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), BlitDimensionsOutOfRange);
+ return false;
}
bool sameBounds = srcX0 == dstX0 && srcY0 == dstY0 && srcX1 == dstX1 && srcY1 == dstY1;