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

Side by Side Diff: third_party/webgl/sdk/tests/conformance/glsl/functions/glsl-function-sin.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 <!--
2
3 /*
4 ** Copyright (c) 2012 The Khronos Group Inc.
5 **
6 ** Permission is hereby granted, free of charge, to any person obtaining a
7 ** copy of this software and/or associated documentation files (the
8 ** "Materials"), to deal in the Materials without restriction, including
9 ** without limitation the rights to use, copy, modify, merge, publish,
10 ** distribute, sublicense, and/or sell copies of the Materials, and to
11 ** permit persons to whom the Materials are furnished to do so, subject to
12 ** the following conditions:
13 **
14 ** The above copyright notice and this permission notice shall be included
15 ** in all copies or substantial portions of the Materials.
16 **
17 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
24 */
25
26 -->
27
28 <!DOCTYPE html>
29 <html>
30 <head>
31 <meta charset="utf-8">
32 <title>GLSL sin function test</title>
33 <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
34 <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/>
35 <script src="../../../resources/js-test-pre.js"></script>
36 <script src="../../resources/webgl-test.js"> </script>
37 <script src="../../resources/webgl-test-utils.js"> </script>
38 <script src="../../resources/glsl-generator.js"> </script>
39 </head>
40 <body>
41 <div id="description"></div>
42 <div id="console"></div>
43 <script>
44
45 var piConstants = [
46 "const float kPI = 3.14159265358979323846;",
47 "const float kHalfPI = (kPI * 0.5);",
48 "const float k2PI = (kPI * 2.0);"
49 ].join("\n");
50
51 var kPI = Math.PI;
52 var kHalfPI = Math.PI * 0.5;
53 var k2PI = Math.PI * 2.0;
54 var sin = Math.sin; // shorthand
55
56 GLSLGenerator.runReferenceImageTest({
57 feature: "sin",
58 args: "$(type) value",
59 testFunc: "$(func)($(type))",
60 gridRes: 8,
61 tolerance: 4,
62 extra: piConstants,
63 tests: [
64 {
65 source: ["$(output) = vec4(",
66 " $(func)($(input).x * kHalfPI + kHalfPI),",
67 " $(func)($(input).y * kHalfPI),",
68 " 0,",
69 " 1);"].join("\n"),
70 generator: function(x, y, z, w) {
71 return [ sin(x * kHalfPI + kHalfPI),
72 sin(y * kHalfPI),
73 0,
74 1 ];
75 },
76 },
77 {
78 source: ["$(output) = vec4(",
79 " $(func)($(input).xy * vec2(kPI, k2PI)) * 0.5 + vec2(0.5, 0.5 ),",
80 " 0, 1);"].join("\n"),
81 generator: function(x, y, z, w) {
82 return [ sin(x * kPI) * 0.5 + 0.5,
83 sin(y * k2PI) * 0.5 + 0.5,
84 0,
85 1 ];
86 },
87 },
88 {
89 source: ["$(output) = vec4(",
90 " $(func)($(input).xyz * vec3(kPI, k2PI, 4.0)) * ",
91 " 0.5 + vec3(0.5, 0.5, 0.5),",
92 " 1);"].join("\n"),
93 generator: function(x, y, z, w) {
94 return [ sin(x * kPI) * 0.5 + 0.5,
95 sin(y * k2PI) * 0.5 + 0.5,
96 sin(z * 4.0) * 0.5 + 0.5,
97 1 ];
98 },
99 },
100 {
101 source: ["$(output) = ",
102 " $(func)($(input) * vec4(k2PI, 4.0, kHalfPI, kPI)) *",
103 " 0.5 + vec4(0.5, 0.5, 0.5, 1);",
104 ].join("\n"),
105 generator: function(x, y, z, w) {
106 return [ sin(x * k2PI) * 0.5 + 0.5,
107 sin(y * 4.0) * 0.5 + 0.5,
108 sin(z * kHalfPI) * 0.5 + 0.5,
109 sin(w * kPI) * 0.5 + 1 ];
110 },
111 },
112 ]
113 });
114 successfullyParsed = true;
115 </script>
116 </body>
117 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698