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

Side by Side Diff: third_party/webgl/conformance-suites/1.0.0/conformance/gl-min-textures-unroll.html

Issue 9360034: Remove everthing except conformance tests in the deps/third_party/webgl (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 8 years, 10 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
OLDNEW
(Empty)
1 <!--
2 Copyright (c) 2009 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
7 "http://www.w3.org/TR/html4/loose.dtd">
8 <html>
9 <head>
10 <title>WebGL the minimum number of uniforms are supported.</title>
11 <link rel="stylesheet" href="../resources/js-test-style.css"/>
12 <script src="../resources/js-test-pre.js"></script>
13 <script src="resources/webgl-test.js"> </script>
14 <script src="resources/webgl-test-utils.js"> </script>
15 </head>
16 <body>
17 <canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></c anvas>
18 <div id="description"></div>
19 <div id="console"></div>
20 <script id="vshader" type="x-shader/x-vertex">
21 attribute vec4 vPosition;
22 void main()
23 {
24 gl_Position = vPosition;
25 }
26 </script>
27
28 <script id="fshader" type="x-shader/x-fragment">
29 #define NUM_TEXTURES 8 // See spec
30 #ifdef GL_ES
31 precision mediump float;
32 #endif
33 uniform sampler2D uni[8];
34 void main()
35 {
36 vec4 c = vec4(0,0,0,0);
37 c += texture2D(uni[0], vec2(0.5, 0.5));
38 c += texture2D(uni[1], vec2(0.5, 0.5));
39 c += texture2D(uni[2], vec2(0.5, 0.5));
40 c += texture2D(uni[3], vec2(0.5, 0.5));
41 c += texture2D(uni[4], vec2(0.5, 0.5));
42 c += texture2D(uni[5], vec2(0.5, 0.5));
43 c += texture2D(uni[6], vec2(0.5, 0.5));
44 c += texture2D(uni[7], vec2(0.5, 0.5));
45 gl_FragColor = c;
46 }
47 </script>
48 <script>
49 var wtu = WebGLTestUtils;
50 var canvas = document.getElementById("example");
51 var gl = wtu.create3DContext(canvas);
52 var program = wtu.setupTexturedQuad(gl);
53
54 //------------------------------------------------------------------------------
55 var program = wtu.setupProgram(
56 gl,
57 [wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER),
58 wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER)],
59 ['vPosition'], [0]);
60
61 for (var ii = 0; ii < 8; ++ii) {
62 var loc = gl.getUniformLocation(program, "uni[" + ii + "]");
63 gl.activeTexture(gl.TEXTURE0 + ii);
64 var tex = gl.createTexture();
65 wtu.fillTexture(gl, tex, 1, 1, [32, 16, 8, ii * 9], 0);
66 gl.uniform1i(loc, ii);
67 }
68
69 wtu.drawQuad(gl);
70 glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
71 wtu.checkCanvas(gl, [255, 128, 64, 252],
72 "Should render using all texture units");
73
74 successfullyParsed = true;
75
76 </script>
77 </body>
78 <script src="../resources/js-test-post.js"></script>
79
80 <script>
81 </script>
82
83 </body>
84 </html>
85
86
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698