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.
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>
17 <div id=
"description"></div>
18 <div id=
"console"></div>
19 <script id=
"vertex-shader" type=
"x-shader/x-vertex">#version
300 es
24 (gl_VertexID /
2 + gl_VertexID /
3) %
2);
25 gl_Position = vec4(vec2(xy) *
2. -
1.,
0,
1);
28 <script id=
"fshader" type=
"x-shader/x-fragment">#version
300 es
29 precision mediump float;
32 result = vec4(
0,
1,
0,
1);
37 description("Test no attribute shaders work as expected");
39 var wtu
= WebGLTestUtils
;
40 var gl
= wtu
.create3DContext(undefined, undefined, 2);
44 var program
= wtu
.setupProgram(gl
, ["vertex-shader", "fshader"], undefined, undefined, true);
46 testFailed('Program compilation failed');
50 gl
.drawArrays(gl
.TRIANGLES
, 0, 6);
51 wtu
.checkCanvas(gl
, [0, 255, 0, 255], "should be green", 0);
55 testFailed("context does not exist");
59 var successfullyParsed
= true;