Move index range calculations into VertexArray.
This is in preparation for removing the entire DrawCallParams struct.
This struct was big enough to cause a performance hit on draw call perf
tests just by virtue of initializing the fields. Also dereferencing the
struct members is slower than reading function parameters since it adds
an indirection.
Also includes some error refactoring to enable moving code to a shared
location.
In total this patch series reduces overhead by up to 5%.
Bug: angleproject:2933
Change-Id: Ib663f2538c14ac30d4c31fd10d6350be469626e2
Reviewed-on: https://chromium-review.googlesource.com/c/1298380
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 2322240..6173442 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -3132,9 +3132,8 @@
if (!context->getExtensions().robustBufferAccessBehavior && count > 0 && primcount > 0)
{
// Use the parameter buffer to retrieve and cache the index range.
- const DrawCallParams ¶ms = context->getParams<DrawCallParams>();
- ANGLE_VALIDATION_TRY(params.ensureIndexRangeResolved(context));
- const IndexRange &indexRange = params.getIndexRange();
+ IndexRange indexRange;
+ ANGLE_VALIDATION_TRY(vao->getIndexRange(context, type, count, indices, &indexRange));
// If we use an index greater than our maximum supported index range, return an error.
// The ES3 spec does not specify behaviour here, it is undefined, but ANGLE should always