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>WebGL Repeated BindAttribLocation Test
</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 <canvas id=
"example" width=
"50" height=
"50">
19 <div id=
"description"></div>
20 <div id=
"console"></div>
21 <script id=
"vshader" type=
"x-shader/x-vertex">
22 attribute vec4 vPosition;
25 gl_Position = vPosition;
29 <script id=
"fshader" type=
"x-shader/x-fragment">
32 gl_FragColor = vec4(
0.0,
1.0,
0.0,
1.0);
38 description("Test repeated loading of programs involving bindAttribLocation calls");
39 debug("Regression test for <a href='https://code.google.com/p/chromium/issues/detail?id=510637'>crbug.com/510637</a>");
40 var wtu
= WebGLTestUtils
;
41 var gl
= wtu
.create3DContext("example");
44 function setup(attribIndex
) {
45 var program
= wtu
.setupProgram(
46 gl
, ['vshader', 'fshader'], ['vPosition'], [attribIndex
]);
48 g_attribLocation
= attribIndex
;
49 shouldBe("gl.getAttribLocation(g_program, 'vPosition')", "g_attribLocation");
56 // This call fails the getAttribLocation check on some drivers when
57 // Chrome's program binary cache is enabled. On the affected drivers,
58 // it returns the bound attribute location from the first binary
59 // created. Swapping 0 and 1 above will cause it to return 1 rather
63 var successfullyParsed
= true;
65 <script src=
"../../js/js-test-post.js"></script>