Implement support for ES 3.0 instanced arrays

BUG=angle:863

Change-Id: I3918c478b33b26b2b179a7f8dd6e4210ecb0cf5c
Reviewed-on: https://chromium-review.googlesource.com/239170
Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/VertexDataManager.cpp b/src/libANGLE/renderer/d3d/VertexDataManager.cpp
index d3eab8b..237c0ad 100644
--- a/src/libANGLE/renderer/d3d/VertexDataManager.cpp
+++ b/src/libANGLE/renderer/d3d/VertexDataManager.cpp
@@ -46,7 +46,9 @@
     // non-instanced vertices, and the instanced vertex index advances once every "mDivisor" instances.
     if (instanceDrawCount > 0 && attrib.divisor > 0)
     {
-        return instanceDrawCount / attrib.divisor;
+        // When instanceDrawCount is not a multiple attrib.divisor, the division must round up.
+        // For instance, with 5 non-instanced vertices and a divisor equal to 3, we need 2 instanced vertices.
+        return (instanceDrawCount + attrib.divisor - 1) / attrib.divisor;
     }
 
     return vertexDrawCount;