Firefox currently doesn't ask the ANGLE compiler to unroll loops.
Benoit
2012/2/3 Patrick Cozzi <pjcoz...@gmail.com>:
For the record, I don't believe Chromium is currently unrolling loops
in the shader translator. That functionality was implemented as a
workaround for driver bugs, but I can't find evidence that it's turned
on. The shader translator does however enforce the WebGL spec's
limitations on loop structure, and there may be a performance bug
there.
-Ken
I'd love to see and fix this performance issue if you can provide a test case.
Mo
Please do file a bug with a test case, and we'll CC our NVIDIA
contacts on it as it does seem like a possible driver bug.
> Perhaps this is actually a
> driver issues; we'll seen it on many different NVIDIA cards, but
> haven't tested others.
>
> With WebGL, I'm not quite sure what the browser does vs. what the
> driver does. I would be really interested in learning about what the
> browser does when we call linkProgram before it goes to the driver/
> ANGLE. Just validation?
The WebGL implementation of linkProgram does really not much more than
call glLinkProgram (and then, query some status.
The WebGL implementation does all the shader validation in the
implementation of compileShader. This is where the ANGLE shader
compiler is used to validate the input.
What typically happens is that the underlying graphics system (D3D or
OpenGL) will delay the actual shader compilation until the time
glLinkProgram is called. So if you're seeing glLinkProgram take
inordinately long, it's quite plausible that it's the GL doing delayed
shader compilation there.
The fact that you're seeing this on both Linux and Windows rules out
the hypothesis of a Direct3D bug, so I'm leaning for a NVIDIA bug.
Cheers,
Benoit
I've confirmed that the problem is reproducible in Chromium on Linux
and goes away if the ANGLE shader translator is sidestepped, so it's
clearly a performance bug in ANGLE. We'll continue to investigate.
-Ken
Benoit
2012/2/7 Kenneth Russell <k...@chromium.org>:
The best hypothesis I have is that renaming of long variables might be
causing hash collisions in the underlying GLSL compiler.
-Ken
Firefox is not yet doing long variables renaming, yet Patrick says
that the bug also occurs in Firefox.
Benoit