validationES: reorder draw validation for the WebGL CTS dEQP
dEQP tries to test specific GL ES errors, but also triggers errors in
the additional WebGL validation. This commit reoders ANGLE's validation so
that WebGL-specific validation for draws is done after the common GL ES
checks.
BUG=angleproject:2021
Change-Id: Ie06b132ef6a4378f7c82ae8d354a8343d897c478
Reviewed-on: https://chromium-review.googlesource.com/493828
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index b8bf5a4..3672a99 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -2785,12 +2785,13 @@
GLsizei count,
GLsizei primcount)
{
- if (context->getExtensions().webglCompatibility && !ValidateDrawInstancedANGLEAndWebGL(context))
+ if (!ValidateDrawArraysInstancedBase(context, mode, first, count, primcount))
{
return false;
}
- return ValidateDrawArraysInstancedBase(context, mode, first, count, primcount);
+ return !context->getExtensions().webglCompatibility ||
+ ValidateDrawInstancedANGLEAndWebGL(context);
}
bool ValidateDrawArraysInstancedANGLE(Context *context,
@@ -2799,12 +2800,12 @@
GLsizei count,
GLsizei primcount)
{
- if (!ValidateDrawInstancedANGLEAndWebGL(context))
+ if (!ValidateDrawArraysInstancedBase(context, mode, first, count, primcount))
{
return false;
}
- return ValidateDrawArraysInstancedBase(context, mode, first, count, primcount);
+ return ValidateDrawInstancedANGLEAndWebGL(context);
}
bool ValidateDrawElementsBase(ValidationContext *context, GLenum type)
@@ -2854,6 +2855,11 @@
const State &state = context->getGLState();
+ if (!ValidateDrawBase(context, mode, count))
+ {
+ return false;
+ }
+
// Check for mapped buffers
if (state.hasMappedBuffer(GL_ELEMENT_ARRAY_BUFFER))
{
@@ -2948,11 +2954,6 @@
}
}
- if (!ValidateDrawBase(context, mode, count))
- {
- return false;
- }
-
// Use the parameter buffer to retrieve and cache the index range.
// TODO: offer fast path, with disabled index validation.
// TODO: also disable index checking on back-ends that are robust to out-of-range accesses.
@@ -2990,12 +2991,13 @@
const void *indices,
GLsizei primcount)
{
- if (context->getExtensions().webglCompatibility && !ValidateDrawInstancedANGLEAndWebGL(context))
+ if (!ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount))
{
return false;
}
- return ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount);
+ return !context->getExtensions().webglCompatibility ||
+ ValidateDrawInstancedANGLEAndWebGL(context);
}
bool ValidateDrawElementsInstancedANGLE(Context *context,
@@ -3005,12 +3007,12 @@
const void *indices,
GLsizei primcount)
{
- if (!ValidateDrawInstancedANGLEAndWebGL(context))
+ if (!ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount))
{
return false;
}
- return ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount);
+ return ValidateDrawInstancedANGLEAndWebGL(context);
}
bool ValidateFramebufferTextureBase(Context *context,