Commit 0dc97810 by Corentin Wallez Committed by Commit Bot

WebGL2 Compat: having no 0 divisor is now valid

BUG=angleproject:TBD Change-Id: Icb19a685290f4313ad567391cab5152eda91a346 Reviewed-on: https://chromium-review.googlesource.com/544545Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org>
parent aed7c570
......@@ -890,7 +890,7 @@ bool ValidateDrawArraysInstancedBase(Context *context,
return (primcount > 0);
}
bool ValidateDrawInstancedANGLEAndWebGL(ValidationContext *context)
bool ValidateDrawInstancedANGLE(ValidationContext *context)
{
// Verify there is at least one active attribute with a divisor of zero
const State &state = context->getGLState();
......@@ -2849,13 +2849,7 @@ bool ValidateDrawArraysInstanced(Context *context,
GLsizei count,
GLsizei primcount)
{
if (!ValidateDrawArraysInstancedBase(context, mode, first, count, primcount))
{
return false;
}
return !context->getExtensions().webglCompatibility ||
ValidateDrawInstancedANGLEAndWebGL(context);
return ValidateDrawArraysInstancedBase(context, mode, first, count, primcount);
}
bool ValidateDrawArraysInstancedANGLE(Context *context,
......@@ -2869,7 +2863,7 @@ bool ValidateDrawArraysInstancedANGLE(Context *context,
return false;
}
return ValidateDrawInstancedANGLEAndWebGL(context);
return ValidateDrawInstancedANGLE(context);
}
bool ValidateDrawElementsBase(ValidationContext *context, GLenum type)
......@@ -3054,13 +3048,7 @@ bool ValidateDrawElementsInstancedCommon(ValidationContext *context,
const void *indices,
GLsizei primcount)
{
if (!ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount))
{
return false;
}
return !context->getExtensions().webglCompatibility ||
ValidateDrawInstancedANGLEAndWebGL(context);
return ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount);
}
bool ValidateDrawElementsInstancedANGLE(Context *context,
......@@ -3075,7 +3063,7 @@ bool ValidateDrawElementsInstancedANGLE(Context *context,
return false;
}
return ValidateDrawInstancedANGLEAndWebGL(context);
return ValidateDrawInstancedANGLE(context);
}
bool ValidateFramebufferTextureBase(Context *context,
......
......@@ -1009,7 +1009,7 @@ TEST_P(WebGL2CompatibilityTest, DrawArraysBufferOutOfBoundsInstanced)
ASSERT_GL_NO_ERROR();
}
// Test that at least one attribute has a zero divisor for WebGL
// Test that having no attributes with a zero divisor is valid in WebGL2
TEST_P(WebGL2CompatibilityTest, InstancedDrawZeroDivisor)
{
const std::string &vert =
......@@ -1040,12 +1040,8 @@ TEST_P(WebGL2CompatibilityTest, InstancedDrawZeroDivisor)
glEnableVertexAttribArray(posLocation);
glVertexAttribDivisor(posLocation, 1);
// Test touching the last element is valid.
glVertexAttribPointer(0, 1, GL_UNSIGNED_BYTE, GL_FALSE, 0, nullptr);
glDrawArraysInstanced(GL_POINTS, 0, 1, 4);
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
glVertexAttribDivisor(posLocation, 0);
ASSERT_GL_NO_ERROR();
}
......
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