Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / glsl3 / no-attribute-vertex-shader.html
blobeabbd9779de569828b5d76c7cc88f787197bead6
1 <!--
2 Copyright (c) 2019 The Khronos Group Inc.
3 Use of this source code is governed by an MIT-style license that can be
4 found in the LICENSE.txt file.
5 -->
7 <!DOCTYPE html>
8 <html>
9 <head>
10 <meta charset="utf-8">
11 <title>Test no attribute vertex shaders</title>
12 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
13 <script src="../../js/js-test-pre.js"></script>
14 <script src="../../js/webgl-test-utils.js"></script>
15 </head>
16 <body>
17 <div id="description"></div>
18 <div id="console"></div>
19 <script id="vertex-shader" type="x-shader/x-vertex">#version 300 es
21 void main() {
22 ivec2 xy = ivec2(
23 gl_VertexID % 2,
24 (gl_VertexID / 2 + gl_VertexID / 3) % 2);
25 gl_Position = vec4(vec2(xy) * 2. - 1., 0, 1);
27 </script>
28 <script id="fshader" type="x-shader/x-fragment">#version 300 es
29 precision mediump float;
30 out vec4 result;
31 void main() {
32 result = vec4(0, 1, 0, 1);
34 </script>
35 <script>
36 "use strict";
37 description("Test no attribute shaders work as expected");
39 var wtu = WebGLTestUtils;
40 var gl = wtu.create3DContext(undefined, undefined, 2);
42 function test() {
43 debug("");
44 var program = wtu.setupProgram(gl, ["vertex-shader", "fshader"], undefined, undefined, true);
45 if (!program) {
46 testFailed('Program compilation failed');
47 return;
50 gl.drawArrays(gl.TRIANGLES, 0, 6);
51 wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 0);
54 if (!gl) {
55 testFailed("context does not exist");
56 } else {
57 test();
59 var successfullyParsed = true;
60 finishTest();
61 </script>
62 </body>
63 </html>