| Test of drawElements with out-of-bounds parameters |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| Test empty index buffer |
| PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 10000, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 10000000000000, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, -1) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, 0) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 1) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, -1) generated expected GL error: INVALID_VALUE. |
| |
| Test buffer with 3 byte indexes |
| PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_INT, 0) generated expected GL error: INVALID_ENUM. |
| PASS context.drawElements(0x0009, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_ENUM. |
| PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 2) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 10000, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 10000000000000, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, -1) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, -1, context.UNSIGNED_BYTE, 1) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, 1, context.UNSIGNED_BYTE, -1) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, 4) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 0xffffffff, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_BYTE, 0x7fffffff) generated expected GL error: INVALID_OPERATION. |
| PASS context.bufferData(context.ELEMENT_ARRAY_BUFFER, (new Uint8Array([ 3, 0, 1, 2 ])).subarray(1), context.STATIC_DRAW) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: NO_ERROR. |
| PASS context.bufferSubData(context.ELEMENT_ARRAY_BUFFER, 0, new Uint8Array([ 3, 0, 1])) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.bufferSubData(context.ELEMENT_ARRAY_BUFFER, 0, (new Uint8Array([ 3, 0, 1, 2 ])).subarray(1)) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_BYTE, 0) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_BYTE, 0) generated expected GL error: NO_ERROR. |
| |
| Test buffer with interleaved (3+2) float vectors |
| PASS context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_SHORT, 0) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 9, context.FLOAT, 0) generated expected GL error: INVALID_ENUM. |
| PASS context.drawElements(context.TRIANGLES, 9, context.SHORT, 0) generated expected GL error: INVALID_ENUM. |
| PASS context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_INT, 0) generated expected GL error: INVALID_ENUM. |
| PASS context.drawElements(context.TRIANGLES, 9, context.UNSIGNED_SHORT, 1000) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 12, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 15, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 18, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_SHORT, 2*15) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 0xffffffff, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_VALUE. |
| PASS context.drawElements(context.TRIANGLES, 0x7fffffff, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 0, context.UNSIGNED_SHORT, 0) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 0) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 1) generated expected GL error: INVALID_OPERATION. |
| PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 2) generated expected GL error: NO_ERROR. |
| PASS context.drawElements(context.TRIANGLES, 6, context.UNSIGNED_SHORT, 0) generated expected GL error: INVALID_OPERATION. |
| |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |