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

Side by Side Diff: conformance/ogles/GL/struct/nestedstructcomb_various_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 #define ERROR_EPSILON 0.1
31
32 void main (void)
33 {
34 struct second_nest
35 {
36 float sc_nt;
37 mat2 sc_mt2;
38 vec4 sc_vc4;
39 };
40
41 struct nest
42 {
43 ivec3 nt_ivc3;
44 bvec4 nt_bvc4;
45 second_nest nt_scne;
46 };
47
48 struct test_t
49 {
50 float t_fl;
51 vec2 t_vc2;
52 vec3 t_vc3;
53 mat4 t_mt4;
54 nest t_nested;
55 float t_2fl;
56 };
57
58 vec4 mt1 = vec4(31.0, 32.0, 33.0, 34.0);
59 vec4 mt2 = vec4(35.0, 36.0, 37.0, 38.0);
60 vec4 mt3 = vec4(39.0, 40.0, 41.0, 42.0);
61 vec4 mt4 = vec4(43.0, 44.0, 45.0, 46.0);
62 int i=0;
63 float sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0;
64
65 test_t a = test_t(23.0, vec2(12.0, 13.0),
66
67 vec3(163.0, 173.0, 183.0),
68
69 mat4(mt1, mt2, mt3, mt4),
70
71 nest( ivec3(73, 74, 75),
72
73 bvec4(12, 0, 17.0, 193.0 ),
74
75 second_nest(144.0, mat2(22.0, 23.0, 24.0, 2 5.0), vec4(57.0, 58.0, 59.0, 60.0 )
76 )
77 ),
78
79 203.0
80 );
81
82 sum1 = a.t_mt4[0][0] + a.t_mt4[0][1] + a.t_mt4[0][2] + a.t_mt4[0][3];
83 sum2 = a.t_mt4[1][0] + a.t_mt4[1][1] + a.t_mt4[1][2] + a.t_mt4[1][3];
84 sum3 = a.t_mt4[2][0] + a.t_mt4[2][1] + a.t_mt4[2][2] + a.t_mt4[2][3];
85 sum4 = a.t_mt4[3][0] + a.t_mt4[3][1] + a.t_mt4[3][2] + a.t_mt4[3][3];
86
87 float gray;
88 if( ( a.t_fl == 23.0 ) &&
89
90 (a.t_vc2[0] == 12.0) && (a.t_vc2[1] == 13.0) &&
91
92 (a.t_vc3[0] == 163.0) && (a.t_vc3[1] == 173.0) && (a.t_vc3[2] == 1 83.0) &&
93
94 (sum1 > 130.0-ERROR_EPSILON && sum1 < 130.0+ERROR_EPSILON ) && (sum 2 > 146.0-ERROR_EPSILON && sum2 < 146.0+ERROR_EPSILON ) && (sum3 >162.0-ERROR_ EPSILON && sum3 < 162.0+ERROR_EPSILON ) && (sum4 > 178.0-ERROR_EPSILON && sum4 < 178.0+ERROR_EPSILON ) &&
95 (a.t_nested.nt_ivc3[0] == 73 ) && (a.t_nested.nt_ivc3[1] == 74 ) && (a.t_nested.nt_ivc3[2] == 75 ) &&
96
97 (a.t_nested.nt_bvc4[0] == true) && (a.t_nested.nt_bvc4[1] == fal se) &&
98
99 (a.t_nested.nt_bvc4[2] == true ) && (a.t_nested.nt_bvc4[0] == tr ue) &&
100
101 (a.t_nested.nt_scne.sc_nt == 144.0) &&
102
103 (a.t_nested.nt_scne.sc_mt2[0][0] == 22.0 ) && (a.t_nested.n t_scne.sc_mt2[0][1] == 23.0 ) &&
104
105 (a.t_nested.nt_scne.sc_mt2[1][0] == 24.0 ) && (a.t_nested.n t_scne.sc_mt2[1][1] == 25.0 ) &&
106
107 (a.t_nested.nt_scne.sc_vc4[0] == 57.0 ) && (a.t_nested.nt_s cne.sc_vc4[1] == 58.0 ) &&
108
109 (a.t_nested.nt_scne.sc_vc4[2] == 59.0 ) && (a.t_nested.nt_s cne.sc_vc4[3] == 60.0) &&
110
111 (a.t_2fl == 203.0)
112 )
113 gray=1.0;
114 else gray=0.0;
115
116 color = vec4(gray, gray, gray, 1.0);
117 gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
118
119 }
OLDNEW
« no previous file with comments | « conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag ('k') | conformance/ogles/GL/struct/struct_001_to_008.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698