Commit 170efbf9 by Corentin Wallez Committed by Commit Bot

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: 's avatarJamie Madill <jmadill@chromium.org>
parent ba29fa47
...@@ -2785,12 +2785,13 @@ bool ValidateDrawArraysInstanced(Context *context, ...@@ -2785,12 +2785,13 @@ bool ValidateDrawArraysInstanced(Context *context,
GLsizei count, GLsizei count,
GLsizei primcount) GLsizei primcount)
{ {
if (context->getExtensions().webglCompatibility && !ValidateDrawInstancedANGLEAndWebGL(context)) if (!ValidateDrawArraysInstancedBase(context, mode, first, count, primcount))
{ {
return false; return false;
} }
return ValidateDrawArraysInstancedBase(context, mode, first, count, primcount); return !context->getExtensions().webglCompatibility ||
ValidateDrawInstancedANGLEAndWebGL(context);
} }
bool ValidateDrawArraysInstancedANGLE(Context *context, bool ValidateDrawArraysInstancedANGLE(Context *context,
...@@ -2799,12 +2800,12 @@ bool ValidateDrawArraysInstancedANGLE(Context *context, ...@@ -2799,12 +2800,12 @@ bool ValidateDrawArraysInstancedANGLE(Context *context,
GLsizei count, GLsizei count,
GLsizei primcount) GLsizei primcount)
{ {
if (!ValidateDrawInstancedANGLEAndWebGL(context)) if (!ValidateDrawArraysInstancedBase(context, mode, first, count, primcount))
{ {
return false; return false;
} }
return ValidateDrawArraysInstancedBase(context, mode, first, count, primcount); return ValidateDrawInstancedANGLEAndWebGL(context);
} }
bool ValidateDrawElementsBase(ValidationContext *context, GLenum type) bool ValidateDrawElementsBase(ValidationContext *context, GLenum type)
...@@ -2854,6 +2855,11 @@ bool ValidateDrawElementsCommon(ValidationContext *context, ...@@ -2854,6 +2855,11 @@ bool ValidateDrawElementsCommon(ValidationContext *context,
const State &state = context->getGLState(); const State &state = context->getGLState();
if (!ValidateDrawBase(context, mode, count))
{
return false;
}
// Check for mapped buffers // Check for mapped buffers
if (state.hasMappedBuffer(GL_ELEMENT_ARRAY_BUFFER)) if (state.hasMappedBuffer(GL_ELEMENT_ARRAY_BUFFER))
{ {
...@@ -2948,11 +2954,6 @@ bool ValidateDrawElementsCommon(ValidationContext *context, ...@@ -2948,11 +2954,6 @@ bool ValidateDrawElementsCommon(ValidationContext *context,
} }
} }
if (!ValidateDrawBase(context, mode, count))
{
return false;
}
// Use the parameter buffer to retrieve and cache the index range. // Use the parameter buffer to retrieve and cache the index range.
// TODO: offer fast path, with disabled index validation. // TODO: offer fast path, with disabled index validation.
// TODO: also disable index checking on back-ends that are robust to out-of-range accesses. // TODO: also disable index checking on back-ends that are robust to out-of-range accesses.
...@@ -2990,12 +2991,13 @@ bool ValidateDrawElementsInstancedCommon(ValidationContext *context, ...@@ -2990,12 +2991,13 @@ bool ValidateDrawElementsInstancedCommon(ValidationContext *context,
const void *indices, const void *indices,
GLsizei primcount) GLsizei primcount)
{ {
if (context->getExtensions().webglCompatibility && !ValidateDrawInstancedANGLEAndWebGL(context)) if (!ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount))
{ {
return false; return false;
} }
return ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount); return !context->getExtensions().webglCompatibility ||
ValidateDrawInstancedANGLEAndWebGL(context);
} }
bool ValidateDrawElementsInstancedANGLE(Context *context, bool ValidateDrawElementsInstancedANGLE(Context *context,
...@@ -3005,12 +3007,12 @@ bool ValidateDrawElementsInstancedANGLE(Context *context, ...@@ -3005,12 +3007,12 @@ bool ValidateDrawElementsInstancedANGLE(Context *context,
const void *indices, const void *indices,
GLsizei primcount) GLsizei primcount)
{ {
if (!ValidateDrawInstancedANGLEAndWebGL(context)) if (!ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount))
{ {
return false; return false;
} }
return ValidateDrawElementsInstancedBase(context, mode, count, type, indices, primcount); return ValidateDrawInstancedANGLEAndWebGL(context);
} }
bool ValidateFramebufferTextureBase(Context *context, bool ValidateFramebufferTextureBase(Context *context,
......
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