Remove IndexRange in DrawElements functions
This change will remove IndexRange parameter in DrawElements functions.
And calculate it until we truly need it. Meanwhile we add direct
drawing path to avoid retrieving index range for DrawElements*
functions in D3D11 backend. This change may not bring much performance
improvement since we still need to retrieve index range in validation
at the beginning of every DrawElements* call entry point.
BUG=angleproject:1393
Change-Id: I86a8739c0893954c94eb398db62820ced7871565
Reviewed-on: https://chromium-review.googlesource.com/544634
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 240dcd8..fab6553 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -1855,8 +1855,7 @@
void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
{
syncRendererState();
- const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
- handleError(mImplementation->drawElements(this, mode, count, type, indices, indexRange));
+ handleError(mImplementation->drawElements(this, mode, count, type, indices));
}
void Context::drawElementsInstanced(GLenum mode,
@@ -1866,9 +1865,8 @@
GLsizei instances)
{
syncRendererState();
- const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
- handleError(mImplementation->drawElementsInstanced(this, mode, count, type, indices, instances,
- indexRange));
+ handleError(
+ mImplementation->drawElementsInstanced(this, mode, count, type, indices, instances));
}
void Context::drawRangeElements(GLenum mode,
@@ -1879,9 +1877,7 @@
const void *indices)
{
syncRendererState();
- const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
- handleError(mImplementation->drawRangeElements(this, mode, start, end, count, type, indices,
- indexRange));
+ handleError(mImplementation->drawRangeElements(this, mode, start, end, count, type, indices));
}
void Context::drawArraysIndirect(GLenum mode, const void *indirect)