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

Side by Side Diff: third_party/webgl/sdk/tests/conformance/glsl/misc/uniform-location-length-limits.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 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <!--
6
7 /*
8 ** Copyright (c) 2012 The Khronos Group Inc.
9 **
10 ** Permission is hereby granted, free of charge, to any person obtaining a
11 ** copy of this software and/or associated documentation files (the
12 ** "Materials"), to deal in the Materials without restriction, including
13 ** without limitation the rights to use, copy, modify, merge, publish,
14 ** distribute, sublicense, and/or sell copies of the Materials, and to
15 ** permit persons to whom the Materials are furnished to do so, subject to
16 ** the following conditions:
17 **
18 ** The above copyright notice and this permission notice shall be included
19 ** in all copies or substantial portions of the Materials.
20 **
21 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
28 */
29
30 -->
31 <title>WebGL uniform location length tests</title>
32 <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
33 <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/>
34 <script src="../../../resources/js-test-pre.js"></script>
35 <script src="../../resources/webgl-test.js"> </script>
36 <script src="../../resources/webgl-test-utils.js"> </script>
37 </head>
38 <body>
39 <canvas id="example" width="50" height="50">
40 There is supposed to be an example drawing here, but it's not important.
41 </canvas>
42 <div id="description">Verify limits on the lengths of uniform locations per WebG L spec, "Maximum Uniform and Attribute Location Lengths".</div>
43 <div id="console"></div>
44 <script id="goodVertexShader" type="x-shader/x-vertex">
45 // A vertex shader where the needed uniform location is exactly 256 characters.
46 struct Nesting2 {
47 vec4 identifier62CharactersLong_01234567890123456789012345678901234;
48 };
49
50 struct Nesting1 {
51 Nesting2 identifier64CharactersLong_0123456789012345678901234567890123456;
52 };
53
54 uniform Nesting1 identifier128CharactersLong_01234567890123456789012345678901234 56789012345678901234567890123456789012345678901234567890123456789;
55
56 void main() {
57 gl_Position = identifier128CharactersLong_0123456789012345678901234567890123 456789012345678901234567890123456789012345678901234567890123456789.identifier64C haractersLong_0123456789012345678901234567890123456.identifier62CharactersLong_0 1234567890123456789012345678901234;
58 }
59 </script>
60 <script id="badVertexShader" type="x-shader/x-vertex">
61 // A vertex shader where the needed uniform location is 257 characters.
62 struct Nesting2 {
63 vec4 identifier63CharactersLong_012345678901234567890123456789012345;
64 };
65
66 struct Nesting1 {
67 Nesting2 identifier64CharactersLong_0123456789012345678901234567890123456;
68 };
69
70 uniform Nesting1 identifier128CharactersLong_01234567890123456789012345678901234 56789012345678901234567890123456789012345678901234567890123456789;
71
72 void main() {
73 Nesting2 temp = identifier128CharactersLong_01234567890123456789012345678901 23456789012345678901234567890123456789012345678901234567890123456789.identifier6 4CharactersLong_0123456789012345678901234567890123456;
74 gl_Position = temp.identifier63CharactersLong_012345678901234567890123456789 012345;
75 }
76 </script>
77 <script id="fragmentShader" type="x-shader/x-fragment">
78 precision mediump float;
79
80 void main() {
81 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
82 }
83 </script>
84 <script>
85 if (window.initNonKhronosFramework) {
86 window.initNonKhronosFramework(false);
87 }
88
89 var wtu = WebGLTestUtils;
90 var gl = wtu.create3DContext("example");
91
92 debug("Test uniform location underneath the length limit");
93 var program = wtu.loadProgramFromScript(gl, "goodVertexShader", "fragmentShader" );
94 shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)', 'true');
95 var uniformLoc = gl.getUniformLocation(program, "identifier128CharactersLong_012 34567890123456789012345678901234567890123456789012345678901234567890123456789012 34567890123456789.identifier64CharactersLong_01234567890123456789012345678901234 56.identifier62CharactersLong_01234567890123456789012345678901234");
96 shouldBeNonNull('uniformLoc');
97 wtu.glErrorShouldBe(gl, gl.NONE);
98
99 debug("Test uniform location over the length limit");
100 program = wtu.loadProgramFromScript(gl, "badVertexShader", "fragmentShader");
101 wtu.glErrorShouldBe(gl, gl.NONE);
102 shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)', 'true');
103 var uniformLoc = gl.getUniformLocation(program, "identifier128CharactersLong_012 34567890123456789012345678901234567890123456789012345678901234567890123456789012 34567890123456789.identifier64CharactersLong_01234567890123456789012345678901234 56.identifier63CharactersLong_012345678901234567890123456789012345");
104 wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
105 shouldBeNull('uniformLoc');
106
107 successfullyParsed = true;
108 </script>
109 <script src="../../../resources/js-test-post.js"></script>
110 </body>
111 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698