[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Support precompiled shaders as extensions

Worth mentioning this topic on that:
http://toji.github.io/shader-perf/ by Brandon Jones.

We already doing something similar, where we access parameters in delayed manner. This only works for assets loading scenarios, and does not work for runtime recompilation.
And even for loading scenario, this still takes ages, and in many cases shader compilation on medium devices can take more than half of loading times in extreme cases, that are seconds, for relatively simple demo cases.


On 12 November 2016 at 20:54, Mr F <arthur@playcanvas.com> wrote:
As there is more and more WebGL content around, shader compilation times start to annoy a lot (just go on shadertoy and see your tab hang for half a minute). Browsers try to cache already compiled shaders, but that's it, it's hardly a solution IMHO. Here's the idea: as we already have platform-dependent extensions for DXT/ETC/PVRTC textures, and they are quite useful indeed, can we do the same for shaders? E.g. if you're on ANGLE, you can have a DX11 shader blob extension. Just feed it the binary, and it works. I don't think there's a security concern with it... you can make browsers compile almost any shader anyway, and they can't mess with unrelated user data.