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 <link rel=
"stylesheet" href=
"../../resources/js-test-style.css"/>
11 <script src=
"../../js/js-test-pre.js"></script>
12 <script src=
"../../js/webgl-test-utils.js"></script>
13 <script src=
"../../js/tests/gl-bindattriblocation-aliasing.js"></script>
14 <title>bindAttribLocation with aliasing - inactive attributes
</title>
17 <div id=
"description"></div>
18 <div id=
"console"></div>
19 <canvas id=
"canvas" width=
"8" height=
"8" style=
"width: 8px; height: 8px;"></canvas>
20 <script id=
"vertexShaderStaticallyUsedButInactive" type=
"text/something-not-javascript">#version
300 es
21 precision mediump float;
25 gl_Position = true ? $(gl_Position_1) : $(gl_Position_2);
28 <script id=
"vertexShaderUnused" type=
"text/something-not-javascript">#version
300 es
29 precision mediump float;
33 gl_Position = vec4(
0.0);
38 description("This test verifies combinations of valid inactive attributes cannot be bound to the same location with bindAttribLocation. GLSL ES 3.00.6 section 12.46.");
39 var wtu
= WebGLTestUtils
;
40 var canvas
= document
.getElementById("canvas");
41 var gl
= wtu
.create3DContext(canvas
, {antialias
: false}, 2);
42 var glFragmentShader
= wtu
.loadShader(gl
, wtu
.simpleColorFragmentShaderESSL300
, gl
.FRAGMENT_SHADER
);
44 debug("Testing with shader that has statically used but inactive attributes.");
45 runBindAttribLocationAliasingTest(wtu
, gl
, glFragmentShader
, wtu
.getScript('vertexShaderStaticallyUsedButInactive'));
48 debug("Testing with shader that has entirely unused attributes.");
49 runBindAttribLocationAliasingTest(wtu
, gl
, glFragmentShader
, wtu
.getScript('vertexShaderUnused'));
51 var successfullyParsed
= true;
53 <script src=
"../../js/js-test-post.js"></script>