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

Side by Side Diff: conformance/ogles/GL/functions/qualifiers_struct_frag.frag

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 #ifdef GL_ES
27 precision mediump float;
28 #endif
29 struct sabcd
30 {
31 float a;
32 float b;
33 float c;
34 float d;
35 };
36
37
38
39 sabcd qualifiers(in sabcd a, out sabcd b, inout sabcd c, const in sabcd d,
40 sabcd e)
41 {
42 sabcd one = sabcd(1.0, 1.0, 1.0, 1.0);
43
44 b = a;
45
46 c.a += d.a;
47 c.b += d.b;
48 c.c += d.c;
49 c.d += d.d;
50
51 a.a += one.a;
52 a.b += one.b;
53 a.c += one.c;
54 a.d += one.d;
55
56 return e;
57 }
58
59 void main (void)
60 {
61 sabcd a = sabcd(1.0, 1.0, 1.0, 1.0);
62 sabcd b = sabcd(2.0, 2.0, 2.0, 2.0);
63 sabcd c = sabcd(3.0, 3.0, 3.0, 3.0);
64 sabcd d = sabcd(4.0, 4.0, 4.0, 4.0);
65 sabcd e = sabcd(1.0, 1.0, 1.0, 1.0);
66 sabcd f = sabcd(0.0, 0.0, 0.0, 0.0);
67 sabcd one = sabcd(1.0, 1.0, 1.0, 1.0);
68 sabcd four = sabcd(4.0, 4.0, 4.0, 4.0);
69 sabcd seven = sabcd(7.0, 7.0, 7.0, 7.0);
70 float q = 0.0;
71 float q2 = 0.0;
72
73 f = qualifiers(a, b, c, d, e);
74
75 if(a == one) q += 1.0;
76 if(b == one) q += 2.0;
77 if(c == seven) q += 4.0;
78 if(d == four) q2 += 1.0;
79 if(e == one) q2 += 2.0;
80 if(f == one) q2 += 4.0;
81
82 gl_FragColor = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0);
83 }
OLDNEW
« no previous file with comments | « conformance/ogles/GL/functions/qualifiers_float_vert.vert ('k') | conformance/ogles/GL/functions/qualifiers_struct_vert.vert » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698