Implement remaining robust Get entry points.

BUG=angleproject:1354

Change-Id: I204962a7178d47a43034d0213c81b82d8f6a25be
Reviewed-on: https://chromium-review.googlesource.com/399043
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp
index 3585e67..03b48b3 100644
--- a/src/libANGLE/validationES3.cpp
+++ b/src/libANGLE/validationES3.cpp
@@ -1779,8 +1779,16 @@
     return ValidateFlushMappedBufferRangeBase(context, target, offset, length);
 }
 
-bool ValidateIndexedStateQuery(ValidationContext *context, GLenum pname, GLuint index)
+bool ValidateIndexedStateQuery(ValidationContext *context,
+                               GLenum pname,
+                               GLuint index,
+                               GLsizei *length)
 {
+    if (length)
+    {
+        *length = 0;
+    }
+
     GLenum nativeType;
     unsigned int numParams;
     if (!context->getIndexedQueryParameterInfo(pname, &nativeType, &numParams))
@@ -1824,10 +1832,9 @@
             return false;
     }
 
-    // pname is valid, but there are no parameters to return
-    if (numParams == 0)
+    if (length)
     {
-        return false;
+        *length = 1;
     }
 
     return true;
@@ -1840,7 +1847,7 @@
         context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.0"));
         return false;
     }
-    return ValidateIndexedStateQuery(context, target, index);
+    return ValidateIndexedStateQuery(context, target, index, nullptr);
 }
 
 bool ValidateGetInteger64i_v(ValidationContext *context, GLenum target, GLuint index, GLint64 *data)
@@ -1850,7 +1857,38 @@
         context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.0"));
         return false;
     }
-    return ValidateIndexedStateQuery(context, target, index);
+    return ValidateIndexedStateQuery(context, target, index, nullptr);
+}
+
+bool ValidateGetInteger64i_vRobustANGLE(ValidationContext *context,
+                                        GLenum target,
+                                        GLuint index,
+                                        GLsizei bufSize,
+                                        GLsizei *length,
+                                        GLint64 *data)
+{
+    if (!context->getGLVersion().isES3OrGreater())
+    {
+        context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.0"));
+        return false;
+    }
+
+    if (!ValidateRobustEntryPoint(context, bufSize))
+    {
+        return false;
+    }
+
+    if (!ValidateIndexedStateQuery(context, target, index, length))
+    {
+        return false;
+    }
+
+    if (!ValidateRobustBufferSize(context, bufSize, *length))
+    {
+        return false;
+    }
+
+    return true;
 }
 
 }  // namespace gl