in-parameter-passed-as-inout-argument-and-global.html (1343B)
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>Function in parameter passed as an inout argument and a global variable with the same name</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="fshaderParameters" type="x-shader/x-fragment"> 21 precision mediump float; 22 uniform vec3 u_zero; 23 vec3 p; 24 void G(inout vec3 q) { 25 p += q; 26 } 27 void F(in vec3 p) { 28 G(p); 29 } 30 void main(){ 31 F(u_zero + vec3(0.0, 1.0, 0.0)); 32 gl_FragColor = vec4(p, 1.0); 33 } 34 </script> 35 <script type="text/javascript"> 36 "use strict"; 37 description(); 38 39 // This is intended to test an issue seen on NVIDIA OpenGL drivers (at least up to version 388.59). 40 // http://crbug.com/792210 41 42 GLSLConformanceTester.runRenderTests([ 43 { 44 fShaderId: 'fshaderParameters', 45 fShaderSuccess: true, 46 linkSuccess: true, 47 passMsg: "Function in parameter passed as an inout argument and a global variable with the same name" 48 } 49 ]); 50 </script> 51 </body> 52 </html>