Commit e8e530ba by Olli Etuaho

Implement drawRangeElements

Implement drawRangeElements simply by calling drawElements internally. The start and end parameters passed to the function will be checked against results from index validation and an error is generated if indices fall outside the claimed range. Most dEQP-GLES3.functional.draw.draw_range_elements.* tests pass after this change. The remaining failures seem to be related to instanced attributes. BUG=angleproject:957 TEST=dEQP-GLES3.functional.draw.* Change-Id: Id3923eb8114461b441e593357bc49babfd6b5c15 Reviewed-on: https://chromium-review.googlesource.com/262420Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
parent 4b07348b
...@@ -59,8 +59,28 @@ void GL_APIENTRY DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsize ...@@ -59,8 +59,28 @@ void GL_APIENTRY DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsize
return; return;
} }
// glDrawRangeElements rx::RangeUI indexRange;
UNIMPLEMENTED(); if (!ValidateDrawElements(context, mode, count, type, indices, 0, &indexRange))
{
return;
}
if (indexRange.end > end || indexRange.start < start)
{
// GL spec says that behavior in this case is undefined - generating an error is fine.
context->recordError(Error(GL_INVALID_OPERATION));
return;
}
// As long as index validation is done, it doesn't matter whether the context receives a drawElements or
// a drawRangeElements call - the GL back-end is free to choose to call drawRangeElements based on the
// validated index range. If index validation is removed, adding drawRangeElements to the context interface
// should be reconsidered.
Error error = context->drawElements(mode, count, type, indices, 0, indexRange);
if (error.isError())
{
context->recordError(error);
return;
}
} }
} }
......
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