[Public WebGL] Fwd: Shared Resources revisited

Vladimir Vukicevic [email protected]
Tue Jun 25 20:04:58 PDT 2013

On 6/25/2013 11:18 AM, Chris Endicott wrote:
> Here's some benchmarks of our shader compile times in the RuneScape 
> engine. RuneScape uses a couple of hundred permutations of shader at 
> run time to handle various combinations of effects/lighting/shadows 
> and so on. It does this to remove control flow statements from the 
> shader source itself, as far as possible.

Hm, it sounds like what you really want, for this in particular, is a 
way to cache compiled shaders.  We were thinking of doing this under the 
hood anyway as we can do it transparently by hashing source + compiler 
details (especially when using D3D via ANGLE, by caching the bytecode).  
That should largely remove this bottleneck for you.

The thing with GL context share groups, as soon as you touch contexts in 
a share group from different threads, you flip on all sorts of 
locking/sync primitives in the GL drivers, which results in an overall 
perf hit.  I think you'd get this even if you were to only use the other 
context to compile shaders.  Of course, that might not be the case for a 
D3D-backed GL, but as mobile WebGL is increasingly becoming viable, 
straight GL implementations are going to become more common.

      - Vlad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20130625/b29ca3fc/attachment.html>

More information about the public_webgl mailing list