Created attachment 106438 [details] GLSL code for the 3 vertex shaders, work-around highlighted in each case. WebGL, chrome + firefox on various devices (all 64bit linux + intel graphics) Devices: 1) Ubuntu 14.04 Intel Core i5 2500K Mesa git a3306f02 2014-09-08 from Xorg-edgers ppa Chrome 37 + Firefox 32 2) Chrome book pixel Intel Core i5 3427U Mesa 10.3.0-devel git 1751a9b Chrome 37 3) Fedora 20 Intel Core i7 3612QM Mesa 10.1.5 Chrome 37 Behaviour: Geometry rendered with 3 particular vertex shaders ends up coming out with seemingly completely randomn positions, with triangles stretched all over the screen in a crazy mess. Adding a single if branch (whose condition is always false) to the shaders fixes behaviour. Behaviour does not occur on windows with intel drivers, or on windows/mac/linux with nvidia drivers. Status with ATI drivers is unknown. Our shaders are written in CG compiled to GLSL, so apologies upfront for atrocious GLSL code. The relevant areas are highlighted. Producing a single reproducible can be done if required, though it would take some time, please let me know if the GLSL code is insufficient. Screenshot without workaround: https://drive.google.com/file/d/0B0DebLXzXCcQYVJEQ0RQSjR6QlU Screenshot with workaround: https://drive.google.com/file/d/0B0DebLXzXCcQalF5WVZiWjBlY2s
Created attachment 106439 [details] screenshot with workaround in place.
Created attachment 106440 [details] Screenshot without workaround in place
For quick referenece, the work-around in each case for the 3 vertex shaders consists of: if (distance < -10.0) { devicePos = 0.0; } where distance is a local variable resulting from a call to length(_) ( and so can never be less than -10.0) and devicePos is another local variable used later in the function. The particular choice was not important, only that our compile step to GLSL from CG did not strip the if-branch from the code.
Can you provide the output of the with and without work-around shaders with the following environment variables set? INTEL_DEBUG=vs MESA_GLSL=dump Looking at differences in the IR and the final generated assembly might shed some light on the situation. The most likely scenario is one of the optimization passes is making a bad choice...
Created attachment 106493 [details] GLSL and IR dumps for the 3 vertex shaders without workarounds No assembly was found for these 3 shaders in the logs.
Created attachment 106494 [details] GLSL and IR dumps for the 3 vertex shaders with workarounds No assembly dumps were found for these 3 shaders in the logs.
Does this still happen with a recent version of Mesa? Its little hard to do anything about this just with the shaders an example app would be useful. There is nothing obvious in the dumps either.
It's been over a year since more information was requested, and a lot longer since the bug was filed. Assuming this was has been fixed and the bug is no longer valid.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.