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

Side by Side Diff: third_party/webgl/sdk/tests/conformance/more/glsl/arrayOutOfBounds.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 <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 = canvas.getContext(GL_CONTEXT_ID);
39 return [gl];
40 }
41
42 Tests.testOk = function(gl) {
43 var sh = new Filter(gl, 'okvert', 'frag');
44 assertOk(function(){sh.apply();});
45 sh.destroy();
46
47 var sh = new Filter(gl, 'vert', 'okfrag');
48 assertOk(function(){sh.apply();});
49 sh.destroy();
50
51 var sh = new Filter(gl, 'vert', 'frag');
52 assertOk(function(){sh.apply();});
53 sh.destroy();
54 }
55
56 var arr = ['cr', 'cw', 'vr', 'vw'];
57 arr.forEach(function(e){
58 Tests['test'+e+'vert'] = function(gl) {
59 var sh = new Filter(gl, e+'vert', 'frag');
60 assertFail(function(){sh.apply();});
61 sh.destroy();
62 }
63 Tests['test'+e+'frag'] = function(gl) {
64 var sh = new Filter(gl, 'vert', e+'frag');
65 assertFail(function(){sh.apply();});
66 sh.destroy();
67 }
68 });
69
70
71 </script>
72 <script id="okvert" type="x-shader/x-vertex">
73
74
75 attribute vec3 Vertex;
76 attribute vec2 Tex;
77 varying vec2 TexCoord;
78 void main()
79 {
80 TexCoord = Tex;
81 float x[3];
82 x[0] = 1.0;
83 x[1] = 2.0;
84 x[2] = 3.0;
85 gl_Position = vec4(Vertex, x[2]);
86 }
87 </script>
88 <script id="crvert" type="x-shader/x-vertex">
89
90
91 attribute vec3 Vertex;
92 attribute vec2 Tex;
93 varying vec2 TexCoord;
94 void main()
95 {
96 TexCoord = Tex;
97 float x[3];
98 x[0] = 1.0;
99 x[1] = 2.0;
100 x[2] = 3.0;
101 gl_Position = vec4(Vertex, x[4]);
102 }
103 </script>
104 <script id="cwvert" type="x-shader/x-vertex">
105
106
107 attribute vec3 Vertex;
108 attribute vec2 Tex;
109 varying vec2 TexCoord;
110 void main()
111 {
112 TexCoord = Tex;
113 float x[3];
114 x[0] = 1.0;
115 x[1] = 2.0;
116 x[2] = 3.0;
117 x[4] = Vertex.z;
118 gl_Position = vec4(Vertex, x[4]);
119 }
120 </script>
121 <script id="vrvert" type="x-shader/x-vertex">
122
123
124 attribute vec3 Vertex;
125 attribute vec2 Tex;
126 varying vec2 TexCoord;
127 void main()
128 {
129 TexCoord = Tex;
130 float x[3];
131 x[0] = 1.0;
132 x[1] = 2.0;
133 x[2] = 3.0;
134 int idx = 4 * int(max(1.0, Vertex.x*20.0));
135 gl_Position = vec4(Vertex, x[idx]);
136 }
137 </script>
138 <script id="vwvert" type="x-shader/x-vertex">
139
140
141 attribute vec3 Vertex;
142 attribute vec2 Tex;
143 varying vec2 TexCoord;
144 void main()
145 {
146 TexCoord = Tex;
147 float x[3];
148 x[0] = 1.0;
149 x[1] = 2.0;
150 x[2] = 3.0;
151 int idx = 4 * int(max(1.0, Vertex.x*20.0));
152 x[idx] = Vertex.z;
153 gl_Position = vec4(Vertex, x[idx]);
154 }
155 </script>
156 <script id="vert" type="x-shader/x-vertex">
157
158
159 attribute vec3 Vertex;
160 attribute vec2 Tex;
161 varying vec2 TexCoord;
162 void main()
163 {
164 TexCoord = Tex;
165 gl_Position = vec4(Vertex, 0.0);
166 }
167 </script>
168
169 <script id="okfrag" type="x-shader/x-fragment">
170
171
172 precision mediump float;
173
174 varying vec2 TexCoord;
175
176 void main()
177 {
178 float x[3];
179 x[0] = 1.0;
180 x[1] = 2.0;
181 x[2] = 3.0;
182 gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[2]);
183 }
184 </script>
185 <script id="crfrag" type="x-shader/x-fragment">
186
187
188 precision mediump float;
189
190 varying vec2 TexCoord;
191
192 void main()
193 {
194 float x[3];
195 x[0] = 1.0;
196 x[1] = 2.0;
197 x[2] = 3.0;
198 gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[4]);
199 }
200 </script>
201 <script id="cwfrag" type="x-shader/x-fragment">
202
203
204 precision mediump float;
205
206 varying vec2 TexCoord;
207
208 void main()
209 {
210 float x[3];
211 x[0] = 1.0;
212 x[1] = 2.0;
213 x[2] = 3.0;
214
215 x[4] = 6.0;
216 gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[4]);
217 }
218 </script>
219 <script id="vrfrag" type="x-shader/x-fragment">
220
221
222 precision mediump float;
223
224 varying vec2 TexCoord;
225
226 void main()
227 {
228 float x[3];
229 x[0] = 1.0;
230 x[1] = 2.0;
231 x[2] = 3.0;
232
233 int idx = 4 * int(max(1.0, TexCoord.x*20.0));
234 gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[idx]);
235 }
236 </script>
237 <script id="vwfrag" type="x-shader/x-fragment">
238
239
240 precision mediump float;
241
242 varying vec2 TexCoord;
243
244 void main()
245 {
246 float x[3];
247 x[0] = 1.0;
248 x[1] = 2.0;
249 x[2] = 3.0;
250
251 int idx = 4 * int(max(1.0, TexCoord.x*20.0));
252 x[idx] = 6.0;
253 gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[idx]);
254 }
255 </script>
256 <script id="frag" type="x-shader/x-fragment">
257
258
259 precision mediump float;
260
261 varying vec2 TexCoord;
262
263 void main()
264 {
265 gl_FragColor = vec4(1.0, 0.0, TexCoord.s, 1.0);
266 }
267 </script>
268
269
270 <style>canvas{ position:absolute; }</style>
271 </head><body>
272 <canvas id="gl" width="16" height="16"></canvas>
273 </body></html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698