Commit 95741743 by Alexis Hetu Committed by Commit Bot

Validation fix for draw with primcount <= 0

A buffer size validation check was returning an invalid operation error based on buffer size, even when primcount is <= 0 (so the buffer isn't used). Fixes the following WebGL 1.0.4 test with SwANGLE: conformance/extensions/angle-instanced-arrays-out-of-bounds.html Bug: b/154628007 Change-Id: Ibfe4eb57f17cd07100fb8dfbe8069e9ec7515160 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168546Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
parent 5540a307
......@@ -983,7 +983,9 @@ ANGLE_INLINE bool ValidateDrawElementsCommon(const Context *context,
return false;
}
if (elementDataSizeWithOffset > static_cast<uint64_t>(elementArrayBuffer->getSize()))
// Related to possible test bug: https://github.com/KhronosGroup/WebGL/issues/3064
if ((elementDataSizeWithOffset > static_cast<uint64_t>(elementArrayBuffer->getSize())) &&
(primcount > 0))
{
context->validationError(GL_INVALID_OPERATION, err::kInsufficientBufferSize);
return false;
......
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