BBBsmoke / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Assigning varying outside on global scope fail silently #878

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to http://www.clicktorelease.com/tmp/varying-bug/index-borked.html
2. on Windows
3.

What is the expected output? What do you see instead?
You should see a UV-mapped cube. Instead nothing is rendered.

What version of the product are you using? On what operating system?
happens on Windows 7 and probably other versions. Firefox, Chrome and IE.

Please provide any additional information below.
Assigning the varying in the main function does work:
http://www.clicktorelease.com/tmp/varying-bug/index-ok.html

even if assigning in the global scope is not correct GLSL, shouldn't there be 
at least a warning, or the shader compilation fail?

this does work on OSX. and it works on Android 4, but crashes the browser in 
Android 5 (https://code.google.com/p/chromium/issues/detail?id=445644)

Original issue reported on code.google.com by the.sp...@gmail.com on 21 Jan 2015 at 11:24

GoogleCodeExporter commented 9 years ago
Initializers at global scope are legal:

"Declarations of globals without a storage qualifier, or with just the const 
qualifier, may include initializers, in which case they will be initialized 
before the first line of main() is executed." (GLSL ES 1.0.17 spec, sec 4.3, pg 
29) Your example is a valid use of global initializer, and shouldn't fail.

Given that it's failing in IE 11 (which does not use ANGLE), but does work on 
IS X (where Chrome uses ANGLE for shader validation) it's likely an issue 
either in HLSL translation or in the D3D shader compiler. (If the former, than 
IE has a similar bug in their translation logic to ANGLE.) We'll take a closer 
look; thanks for the report!

Original comment by shannonw...@chromium.org on 22 Jan 2015 at 12:46

GoogleCodeExporter commented 9 years ago
Yeah, I think this is a shader translator bug. We use global proxy variables 
for varyings, which get initialized after the global statics, and we end up 
with the uninitialized varying values stored in the global static.

I can take a look at this, we should add a WebGL test as well.

Original comment by jmad...@chromium.org on 22 Jan 2015 at 3:08

GoogleCodeExporter commented 9 years ago
Fixed in https://chromium-review.googlesource.com/243581. Still needs a WebGL 
test, I think. Leaving this bug open, and cc'ing Mo and Brandon to check on the 
WebGL test presence.

Original comment by jmad...@chromium.org on 24 Feb 2015 at 10:07