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

Side by Side Diff: conformance/more/glsl/uniformOutOfBounds.html

Issue 41503006: Add ToT WebGL conformance tests : part 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « conformance/more/glsl/longLoops.html ('k') | conformance/more/glsl/unusedAttribsUniforms.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
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 <link rel="stylesheet" type="text/css" href="../unit.css" />
32 <script type="application/x-javascript" src="../unit.js"></script>
33 <script type="application/x-javascript" src="../util.js"></script>
34 <script type="application/x-javascript">
35
36 Tests.startUnit = function () {
37 var canvas = document.getElementById('gl');
38 var gl = getGLContext(canvas);
39 return [gl];
40 }
41
42 var arr = ['cr', 'cw', 'vr', 'vw', 'tvw'];
43 arr.forEach(function(e){
44 Tests['test'+e+'vert'] = function(gl) {
45 var sh = new Filter(gl, e+'vert', 'frag');
46 assertFail(function(){sh.apply(function(f){
47 f.uniform3fv('x', [0.0, 1.0, 2.0]);
48 throwError(e+"vert");
49 });});
50 sh.destroy();
51 }
52 Tests['test'+e+'frag'] = function(gl) {
53 var sh = new Filter(gl, 'vert', e+'frag');
54 assertFail(function(){sh.apply(function(f){
55 f.uniform3fv('x', [0.0, 1.0, 2.0]);
56 throwError(e+"frag");
57 });});
58 sh.destroy();
59 }
60 });
61
62 </script>
63 <script id="crvert" type="x-shader/x-vertex">
64
65
66 attribute vec3 Vertex; attribute vec2 Tex;
67 uniform float x[3];
68 void main()
69 {
70 gl_Position = vec4(Vertex.st, Tex.s, x[4]);
71 }
72 </script>
73 <script id="cwvert" type="x-shader/x-vertex">
74
75
76 attribute vec3 Vertex; attribute vec2 Tex;
77 uniform float x[3];
78 void main()
79 {
80 x[4] = Vertex.z;
81 gl_Position = vec4(Vertex.st, Tex.s, x[4]);
82 }
83 </script>
84 <script id="vrvert" type="x-shader/x-vertex">
85
86
87 uniform float x[3];
88 attribute vec3 Vertex; attribute vec2 Tex;
89 void main()
90 {
91 float idx = 40.0 * max(1.0, Vertex.x*20.0);
92 gl_Position = vec4(Vertex, x[2] + Tex.s + x[int(idx)]);
93 }
94 </script>
95 <script id="vwvert" type="x-shader/x-vertex">
96
97
98 attribute vec3 Vertex; attribute vec2 Tex;
99 uniform float x[3];
100 void main()
101 {
102 int idx = 4 * int(max(1.0, Vertex.x*20.0));
103 x[idx] = Vertex.z;
104 gl_Position = vec4(Vertex.st, Tex.s, x[idx]);
105 }
106 </script>
107 <script id="tvwvert" type="x-shader/x-vertex">
108
109
110 attribute vec3 Vertex; attribute vec2 Tex;
111 uniform float x[3];
112 void main()
113 {
114 int idx = 4 * int(max(1.0, Vertex.x*20.0));
115 x[2] = Vertex[idx];
116 gl_Position = vec4(Vertex.st, Tex.s, x[2]);
117 }
118 </script>
119 <script id="vert" type="x-shader/x-vertex">
120
121
122 attribute vec3 Vertex; attribute vec2 Tex;
123 varying vec2 TexCoord;
124 void main()
125 {
126 TexCoord = Vertex.st;
127 gl_Position = vec4(Vertex, Tex.s);
128 }
129 </script>
130
131 <script id="crfrag" type="x-shader/x-fragment">
132
133
134 precision mediump float;
135
136 uniform float x[3];
137
138 varying vec2 TexCoord;
139 void main()
140 {
141 gl_FragColor = vec4(1.0, 0.0, 0.0, x[4]);
142 }
143 </script>
144 <script id="cwfrag" type="x-shader/x-fragment">
145
146
147 precision mediump float;
148
149 uniform float x[3];
150
151 varying vec2 TexCoord;
152 void main()
153 {
154 x[4] = 6.0;
155 gl_FragColor = vec4(1.0, 0.0, 0.0, x[4]);
156 }
157 </script>
158 <script id="vrfrag" type="x-shader/x-fragment">
159
160
161 precision mediump float;
162
163 uniform float x[3];
164
165 varying vec2 TexCoord;
166 void main()
167 {
168 int idx = 4 * int(max(1.0, TexCoord.s*20.0));
169 gl_FragColor = vec4(1.0, 0.0, 0.0, x[idx]);
170 }
171 </script>
172 <script id="vwfrag" type="x-shader/x-fragment">
173
174
175 precision mediump float;
176
177 uniform float x[3];
178
179 varying vec2 TexCoord;
180 void main()
181 {
182 int idx = 4 * int(max(1.0, TexCoord.s*20.0));
183 x[idx] = 6.0;
184 gl_FragColor = vec4(1.0, 0.0, 0.0, x[idx]);
185 }
186 </script>
187 <script id="tvwfrag" type="x-shader/x-fragment">
188
189
190 precision mediump float;
191
192 uniform float x[3];
193
194 varying vec2 TexCoord;
195 void main()
196 {
197 int idx = 4 * int(max(1.0, TexCoord.s*20.0));
198 x[2] = TexCoord[idx];
199 gl_FragColor = vec4(1.0, 0.0, 0.0, x[2]);
200 }
201 </script>
202 <script id="frag" type="x-shader/x-fragment">
203
204
205 precision mediump float;
206
207 void main()
208 {
209 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
210 }
211 </script>
212
213
214 <style>canvas{ position:absolute; }</style>
215 </head><body>
216 <canvas id="gl" width="1" height="1"></canvas>
217 </body></html>
OLDNEW
« no previous file with comments | « conformance/more/glsl/longLoops.html ('k') | conformance/more/glsl/unusedAttribsUniforms.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698