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 <title>Verify drawing without any enabled vertex attribute arrays
</title>
11 <meta charset=
"utf-8">
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 <script id='vshader' type='x-shader/x-vertex'
>#version
300 es
16 layout(location=
0) in vec4 inColor;
17 out vec4 varyingColor;
20 varyingColor = inColor;
21 gl_Position = vec4(
0.0,
0.0,
0.0,
1.0);
25 <script id='fshader' type='x-shader/x-fragment'
>#version
300 es
26 precision mediump float;
28 layout(location=
0) out vec4 oColor;
31 oColor = varyingColor;
38 var wtu
= WebGLTestUtils
;
39 var gl
= wtu
.create3DContext("testCanvas", undefined, 2);
41 testFailed('could not create context');
44 var program
= wtu
.setupProgram(gl
, ['vshader', 'fshader']);
45 gl
.disableVertexAttribArray(0);
46 gl
.vertexAttrib4f(0, 0.0, 1.0, 0.0, 1.0);
47 gl
.clearColor(1, 0, 0, 1);
48 gl
.clear(gl
.COLOR_BUFFER_BIT
| gl
.DEPTH_BUFFER_BIT
);
49 gl
.drawArrays(gl
.POINTS
, 0, 1);
50 wtu
.checkCanvas(gl
, [ 0, 255, 0, 255 ], "Canvas should be covered by a single green point");
55 <canvas id=
"testCanvas" width=
"1" height=
"1" style=
"width: 32px; height: 32px;"></canvas>
56 <div id=
"description"></div>
57 <div id=
"console"></div>
62 var successfullyParsed
= true;
64 <script src=
"../../js/js-test-post.js"></script>