lion0406 / angleproject

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

Possible issues with new shader transformations to avoid loop unrolling #370

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It appears there may be some issues in the recently introduced shader 
transformations designed to avoid unrolling of loops in the HLSL compiler. 
Several complex WebGL samples fail to run with ANGLE.

http://code.google.com/p/chromium/issues/detail?id=153105 describes the issue 
and has links to some of the failing WebGL samples, which fail in Chrome 22 and 
later, including Chrome Canary.

A couple of errors are reported by the HLSL compiler:

(47,4) error X3528: can't emit if statement with both gradients and program 
flow control

(30,5): error X4505: maximum temp register index exceeded

The first one sounds related to the recent shader transformations. The second 
it isn't clear.

Original issue reported on code.google.com by kbr@chromium.org on 29 Sep 2012 at 1:32

GoogleCodeExporter commented 9 years ago
It appears to be caused, at least in part, by r1162. This is the revision that 
returns things to be rendered upside-down again with a vertical flip on 
glSwapBuffers.

The odd thing is that this patch should actually simplify the shaders a bit due 
to not having to flip the texture coordinates, so it should in theory be less 
likely to run out of registers during compilation (error X4505). Interestingly 
the optimization level also doesn't seem to matter.

I suspect that perhaps the texture coordinate flipping makes the HLSL compiler 
treat loops differently due to not using the input registers directly. I'll 
have a look at the assembly code that gets generated to see what's going on...

Original comment by nicolas....@gmail.com on 2 Oct 2012 at 3:13

GoogleCodeExporter commented 9 years ago
Can we close this with the work around that Al added in r1289?

Original comment by dan...@transgaming.com on 9 Oct 2012 at 12:56

GoogleCodeExporter commented 9 years ago
Yes, let's do that.

Original comment by kbr@chromium.org on 9 Oct 2012 at 5:49