Commit ded1b5a6 by Corentin Wallez Committed by Commit Bot

WebGL Compat: make sure to test the correct error

In ForbidsClientSideElementArrayBuffer we test that WebGL Compatibility returns a GL_INVALID_OPERATION but on NVIDIA Shield, the pointer had the top bit set and caused a GL_INVALID_VALUE to be generated instead. Use a intptr_t(1) for indices to test the correct error. BUG=angleproject:1523 Change-Id: I1497694264befa14b2b6df167b4f20fdbb707983 Reviewed-on: https://chromium-review.googlesource.com/452547Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent ddb5eb56
...@@ -243,10 +243,12 @@ TEST_P(WebGLCompatibilityTest, ForbidsClientSideElementBuffer) ...@@ -243,10 +243,12 @@ TEST_P(WebGLCompatibilityTest, ForbidsClientSideElementBuffer)
glVertexAttribPointer(posLocation, 3, GL_FLOAT, GL_FALSE, 0, 0); glVertexAttribPointer(posLocation, 3, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexAttribArray(posLocation); glEnableVertexAttribArray(posLocation);
const GLubyte indices[] = {0, 1, 2, 3, 4, 5};
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);
// Use the pointer with value of 1 for indices instead of an actual pointer because WebGL also
// enforces that the top bit of indices must be 0 (i.e. offset >= 0) and would generate
// GL_INVALID_VALUE in that case. Using a null pointer gets caught by another check.
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, reinterpret_cast<const void*>(intptr_t(1)));
EXPECT_GL_ERROR(GL_INVALID_OPERATION); EXPECT_GL_ERROR(GL_INVALID_OPERATION);
} }
......
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