invariant-does-not-leak-across-shaders.html (1975B)
1 <!-- 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. 5 --> 6 7 <!DOCTYPE html> 8 <html> 9 <head> 10 <meta charset="utf-8"> 11 <title>Invariant does not leak across 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> 15 <script src="../../../js/glsl-conformance-test.js"></script> 16 </head> 17 <body> 18 <div id="description"></div> 19 <div id="console"></div> 20 <script id="InvariantVertex" type="x-shader/x-vertex"> 21 varying vec4 v_varying; 22 invariant v_varying; 23 24 void main() 25 { 26 gl_Position = v_varying; 27 } 28 </script> 29 <script id="InvariantFragment" type="x-shader/x-fragment"> 30 precision mediump float; 31 invariant varying vec4 v_varying; 32 33 void main() 34 { 35 gl_FragColor = v_varying; 36 } 37 </script> 38 <script id="VertexWithVarying" type="x-shader/x-vertex"> 39 varying vec4 v_varying; 40 41 void main() { 42 gl_Position = v_varying; 43 } 44 </script> 45 <script type="text/javascript"> 46 "use strict"; 47 description("The use of the invariant qualifier in one shader must not affect other shaders."); 48 49 debug(""); 50 debug("This is a deliberate subset of conformance/glsl/misc/shaders-with-invariance.html."); 51 debug("Compared with the original tests, order of the tests is different."); 52 debug("This test covers an ANGLE bug. See crbug.com/634813."); 53 54 GLSLConformanceTester.runTests([ 55 { 56 vShaderId: "InvariantVertex", 57 vShaderSuccess: true, 58 fShaderId: "InvariantFragment", 59 fShaderSuccess: true, 60 linkSuccess: true, 61 passMsg: "Shaders using invariant qualifier should compile and link." 62 }, 63 { 64 vShaderId: "VertexWithVarying", 65 vShaderSuccess: true, 66 fShaderId: "InvariantFragment", 67 fShaderSuccess: true, 68 linkSuccess: false, 69 passMsg: "vertex shader with variant varying and fragment shader with invariant varying must fail" 70 }, 71 ]); 72 </script> 73 </body> 74 </html>