Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1366)

Side by Side Diff: third_party/webgl/sdk/tests/conformance/buffers/index-validation-copies-indices.html

Issue 10399113: Roll webgl conformance tests to r17874: part 2, adding r17874 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!--
2 /*
3 ** Copyright (c) 2012 The Khronos Group Inc.
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining a
6 ** copy of this software and/or associated documentation files (the
7 ** "Materials"), to deal in the Materials without restriction, including
8 ** without limitation the rights to use, copy, modify, merge, publish,
9 ** distribute, sublicense, and/or sell copies of the Materials, and to
10 ** permit persons to whom the Materials are furnished to do so, subject to
11 ** the following conditions:
12 **
13 ** The above copyright notice and this permission notice shall be included
14 ** in all copies or substantial portions of the Materials.
15 **
16 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
23 */
24 -->
25 <!DOCTYPE html>
26 <html>
27 <head>
28 <meta charset="utf-8">
29 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
30 <script src="../../resources/js-test-pre.js"></script>
31 <script src="../resources/webgl-test.js"></script>
32 </head>
33 <body>
34 <div id="description"></div>
35 <div id="console"></div>
36
37 <script>
38 description('Test that client data is always copied during bufferData and buffer SubData calls, because otherwise the data the GL uses to draw may differ from th at checked by the index validation code.')
39
40 var context = create3DContext();
41 var program = loadStandardProgram(context);
42
43 context.useProgram(program);
44 var vertexObject = context.createBuffer();
45 context.enableVertexAttribArray(0);
46 context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
47 // 4 vertices -> 2 triangles
48 context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
49 context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
50
51 var indexObject = context.createBuffer();
52
53 context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
54 var indices = new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]);
55 context.bufferData(context.ELEMENT_ARRAY_BUFFER, indices, context.STATIC_DRAW);
56 shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.T RIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
57 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements( context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
58 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements( context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
59 indices[0] = 2;
60 indices[5] = 1;
61 shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.T RIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
62 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements( context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
63 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements( context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
64
65 debug("")
66 successfullyParsed = true;
67 </script>
68
69 <script src="../../resources/js-test-post.js"></script>
70 </body>
71 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698