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>Bug - indexing with 'int()' should not crash
</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 <script src=
"../../../js/glsl-conformance-test.js"></script>
18 <canvas id=
"example" width=
"40" height=
"40"> </canvas>
19 <div id=
"description"></div>
20 <div id=
"console"></div>
21 <script id=
"vshader" type=
"x-shader/x-vertex">
23 gl_Position = vec4(
0.0,
0.0,
0.0,
1.0);
26 <script id=
"fshaderTest" type=
"x-shader/x-fragment">
27 precision mediump float;
28 uniform vec4 uniformVec;
29 uniform mat4 uniformMat;
30 uniform float uniformArray[
4];
33 vec4 tempVec = vec4(
0.0);
34 mat4 tempMat = mat4(
0.0);
36 gl_FragColor = vec4($(indexed)[int()]);
41 var wtu
= WebGLTestUtils
;
43 var fTestSource
= wtu
.getScript("fshaderTest");
47 var indexedValues
= ['tempVec', 'tempMat[0]', 'tempArray', 'uniformVec', 'uniformMat[0]', 'uniformArray'];
49 for (var i
= 0; i
< indexedValues
.length
; ++i
) {
50 var subs
= {indexed
: indexedValues
[i
]};
54 fShaderSource
: wtu
.replaceParams(fTestSource
, subs
),
55 fShaderSuccess
: false,
57 passMsg
: "shader with invalid index expression int() should not compile",
60 GLSLConformanceTester
.runTests(tests
);