unary-minus-operator-float-bug.html (1395B)
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>GLSL unary minus operator with float bug Tests</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="fshader" type="x-shader/x-fragment"> 21 precision mediump float; 22 void main () { 23 float f = -1.0; 24 // atan(tan(0.5), -f) is in range [1.5707, 1.5708) on Mac OSX 10.11 with Intel GPU. 25 // But it should be 0.5. 26 gl_FragColor = vec4(atan(tan(0.5), -f), 0.0, 0.0, 1.0); 27 } 28 </script> 29 <script> 30 "use strict"; 31 description("Test for unary minus operator with float bug on MacOSX 10.11 with Intel GPU"); 32 debug("This is a regression test for <a href='https://bugs.chromium.org/p/chromium/issues/detail?id=308366'>Chromium Issue 308366</a>"); 33 debug(""); 34 35 GLSLConformanceTester.runRenderTests([ 36 { 37 fShaderId: 'fshader', 38 fShaderSuccess: true, 39 linkSuccess: true, 40 passMsg: "Evaluate unary minus operator and atan(x, y)", 41 renderTolerance: 3, 42 renderColor: [127, 0, 0, 255] 43 } 44 ]); 45 46 </script> 47 48 </body> 49 </html>