Remove HasIndexRange.

This is superseded by the DrawCallParams class. Instead of
storing the context, we also return an error from the index
range resolution.

Bug: angleproject:2389
Change-Id: I9e7d58f006f51872eb3b52cbb9efbee16fff7ef6
Reviewed-on: https://chromium-review.googlesource.com/960570
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp
index 07f8058..7ff676c 100644
--- a/src/libANGLE/validationES3.cpp
+++ b/src/libANGLE/validationES3.cpp
@@ -1284,15 +1284,12 @@
     }
 
     // Use the parameter buffer to retrieve and cache the index range.
-    const auto &params        = context->getParams<HasIndexRange>();
-    const auto &indexRangeOpt = params.getIndexRange();
-    if (!indexRangeOpt.valid())
-    {
-        // Unexpected error.
-        return false;
-    }
+    const DrawCallParams &params = context->getParams<DrawCallParams>();
+    ANGLE_VALIDATION_TRY(params.ensureIndexRangeResolved(context));
 
-    if (indexRangeOpt.value().end > end || indexRangeOpt.value().start < start)
+    const IndexRange &indexRange = params.getIndexRange();
+
+    if (indexRange.end > end || indexRange.start < start)
     {
         // GL spec says that behavior in this case is undefined - generating an error is fine.
         context->handleError(InvalidOperation() << "Indices are out of the start, end range.");