2 Copyright (c) 2019 The Khronos Group Inc.
3 Use of this source code is governed by an MIT-style license that can be
4 found in the LICENSE.txt file.
10 <meta charset=
"utf-8">
11 <link rel=
"stylesheet" href=
"../../resources/js-test-style.css"/>
12 <script src=
"../../js/js-test-pre.js"></script>
13 <script src=
"../../js/webgl-test-utils.js"></script>
14 <script src=
"../../js/tests/out-of-bounds-test.js"></script>
17 <div id=
"description"></div>
18 <div id=
"console"></div>
22 description("Test of drawArraysInstancedANGLE and drawElementsInstancedANGLE with out-of-bounds parameters");
24 var wtu
= WebGLTestUtils
;
26 var gl
= wtu
.create3DContext();
27 var ext
= wtu
.getExtensionWithKnownPrefixes(gl
, "ANGLE_instanced_arrays");
29 testPassed("No ANGLE_instanced_arrays support -- this is legal");
31 testPassed("Successfully enabled ANGLE_instanced_arrays extension");
33 debug("Test with 1 instance without instanced attributes");
35 OutOfBoundsTest
.runDrawArraysTest("ext.drawArraysInstancedANGLE(gl.TRIANGLES, $(offset), $(count), 1)", gl
, wtu
, ext
);
37 OutOfBoundsTest
.runDrawElementsTest("ext.drawElementsInstancedANGLE(gl.TRIANGLES, $(count), $(type), $(offset), 1)", gl
, wtu
, ext
);
39 debug("Test with 2 instances without instanced attributes");
41 OutOfBoundsTest
.runDrawArraysTest("ext.drawArraysInstancedANGLE(gl.TRIANGLES, $(offset), $(count), 2)", gl
, wtu
, ext
);
43 OutOfBoundsTest
.runDrawElementsTest("ext.drawElementsInstancedANGLE(gl.TRIANGLES, $(count), $(type), $(offset), 2)", gl
, wtu
, ext
);
45 OutOfBoundsTest
.runDrawArraysInstancedTest("ext.drawArraysInstancedANGLE(gl.TRIANGLES, $(offset), $(count), $(primcount))", gl
, wtu
, ext
);
47 OutOfBoundsTest
.runDrawElementsInstancedTest("ext.drawElementsInstancedANGLE(gl.TRIANGLES, $(count), $(type), $(offset), $(primcount))", gl
, wtu
, ext
);
51 var successfullyParsed
= true;
54 <script src=
"../../js/js-test-post.js"></script>