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

Side by Side Diff: conformance/ogles/GL/functions/array_float_vert.vert

Issue 41993002: Add ToT WebGL conformance tests : part 9 (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
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
26 attribute vec4 gtf_Vertex;
27 uniform mat4 gtf_ModelViewProjectionMatrix;
28 varying vec4 color;
29
30
31
32 void qualifiers(in float a[4], out float b[4], inout float c[4], const in float d[4], float e[4])
33 {
34 b[0] = a[0];
35 c[0] += d[0];
36 a[0] += 1.0;
37 e[0] += 1.0;
38
39 b[1] = a[1];
40 c[1] += d[1];
41 a[1] += 1.0;
42 e[1] += 1.0;
43
44 b[2] = a[2];
45 c[2] += d[2];
46 a[2] += 1.0;
47 e[2] += 1.0;
48
49 b[3] = a[3];
50 c[3] += d[3];
51 a[3] += 1.0;
52 e[3] += 1.0;
53 }
54
55
56
57
58 void main (void)
59 {
60 float a[4];
61 float b[4];
62 float c[4];
63 float d[4];
64 float e[4];
65 float q = 0.0;
66 float q2 = 0.0;
67
68 a[0] = 1.0;
69 b[0] = 2.0;
70 c[0] = 3.0;
71 d[0] = 4.0;
72 e[0] = 1.0;
73
74 a[1] = 1.0;
75 b[1] = 2.0;
76 c[1] = 3.0;
77 d[1] = 4.0;
78 e[1] = 1.0;
79
80 a[2] = 1.0;
81 b[2] = 2.0;
82 c[2] = 3.0;
83 d[2] = 4.0;
84 e[2] = 1.0;
85
86 a[3] = 1.0;
87 b[3] = 2.0;
88 c[3] = 3.0;
89 d[3] = 4.0;
90 e[3] = 1.0;
91
92 qualifiers(a, b, c, d, e);
93
94 // randomly test a value
95 if(a[0] == 1.0) q += 1.0;
96 if(b[1] == 1.0) q += 2.0;
97 if(c[2] == 7.0) q += 4.0;
98 if(d[3] == 4.0) q2 += 1.0;
99 if(e[0] == 1.0) q2 += 2.0;
100
101 color = vec4(vec2(q / 7.0, q2 / 3.0), 1.0, 1.0);
102 gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698