gxquickly / angleproject

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

ANGLE breaks valid shaders with for-loops by unrolling them #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For a good description see 
https://groups.google.com/group/angleproject/browse_thread/thread/79668c187aa2a1
76/256fa6d01ca7c9ee

There is even a working suggestion/patch in there on how to fix it.

The reason I created an issue is that nothing happened since the problem was 
reported and the current behavior simply makes it impossible to write complex 
shaders incorporating large for-loops (with 64 iterations already being 'large' 
in my case).

The reasoning behind the fix is simple: Applying the fix allows complex shaders 
while potentially trading a little performance. Not applying the fix breaks 
valid shaders.

Original issue reported on code.google.com by cc.zer...@gmail.com on 11 Aug 2011 at 12:22

GoogleCodeExporter commented 9 years ago

Original comment by kbr@chromium.org on 11 Aug 2011 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by nicolas....@gmail.com on 15 Nov 2011 at 8:33

GoogleCodeExporter commented 9 years ago
The problem with the [loop] attribute is that it causes an error if a loop 
demands unrolling. This happens for instance when using gradient instructions, 
or on some devices when the loop takes more than 255 iterations. Applying the 
suggested patch causes some conformance tests to fail.

Note that unrolling any or all loops is not against the ESSL spec, and shader 
compilation can fail when running out of resources (registers or instruction 
slots). So the reality is that WebGL can't guarantee that complex shaders will 
compile.

Original comment by nicolas....@gmail.com on 16 Nov 2011 at 5:49

GoogleCodeExporter commented 9 years ago

Original comment by c...@chromium.org on 7 Dec 2013 at 4:09

GoogleCodeExporter commented 9 years ago
This was fixed by outputting "Lod0" functions which don't cause unrolling of 
loops. We've added the ability to recompile shaders with PREFER_UNROLL and 
AVOID_UNROLL flags.  The shader complexity supported by our D3D9 back-end now 
meets expectations.

Original comment by c...@chromium.org on 21 May 2014 at 3:49