Commit 506fc9c9 by Corentin Wallez Committed by Commit Bot

Add test for WebGL compatibility restriction on GL_FIXED and max stride

BUG=angleproject:1523 Change-Id: If3ab8fa9d7e80f7abb2f4ac864a936e93dfd902c Reviewed-on: https://chromium-review.googlesource.com/422963Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent 66a41a28
...@@ -272,6 +272,34 @@ TEST_P(WebGLCompatibilityTest, RequiresSameStencilMaskAndRef) ...@@ -272,6 +272,34 @@ TEST_P(WebGLCompatibilityTest, RequiresSameStencilMaskAndRef)
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
} }
// Test that GL_FIXED is forbidden
TEST_P(WebGLCompatibilityTest, ForbidsGLFixed)
{
GLBuffer buffer;
glBindBuffer(GL_ARRAY_BUFFER, buffer.get());
glBufferData(GL_ARRAY_BUFFER, 16, nullptr, GL_STATIC_DRAW);
glVertexAttribPointer(0, 1, GL_FLOAT, GL_FALSE, 0, nullptr);
ASSERT_GL_NO_ERROR();
glVertexAttribPointer(0, 1, GL_FIXED, GL_FALSE, 0, nullptr);
EXPECT_GL_ERROR(GL_INVALID_ENUM);
}
// Test the WebGL limit of 255 for the attribute stride
TEST_P(WebGLCompatibilityTest, MaxStride)
{
GLBuffer buffer;
glBindBuffer(GL_ARRAY_BUFFER, buffer.get());
glBufferData(GL_ARRAY_BUFFER, 1024, nullptr, GL_STATIC_DRAW);
glVertexAttribPointer(0, 1, GL_UNSIGNED_BYTE, GL_FALSE, 255, nullptr);
ASSERT_GL_NO_ERROR();
glVertexAttribPointer(0, 1, GL_UNSIGNED_BYTE, GL_FALSE, 256, nullptr);
EXPECT_GL_ERROR(GL_INVALID_VALUE);
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these // Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against. // tests should be run against.
ANGLE_INSTANTIATE_TEST(WebGLCompatibilityTest, ANGLE_INSTANTIATE_TEST(WebGLCompatibilityTest,
......
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