Hi all
I'm trying to design a policy for my shader cache in my rendering engine.
There is little to say about D3D11, let's talk about opengl.
As we know that there is no IL in opengl, any binary shader format is hardware and driver dependent. So it is mandatory to pack the GLSL source in the final release application. And as far as I know, UE3 uses GLSL as the format of shader cache.
For shader cache format, there are several options:
- GLSL shader source files. ( No cache at all. Slowest. )
- GLSL shader cache. ( UE3 way of doing it. Maybe a little faster due to efficient way of file loading. )
- GLSL shader binary cache. ( There is no guarantee that it is supported on all hardware. And it still needs link. Should be faster in creating shaders.)
- GLSL program binary cache. ( A better way of doing it. No need to compile or link. Should be quite fast. However it may suffer from shader explosion issues.)
- GLSL seperate program binary cache. ( No shader explosion issue. And fast to initialize. )
In terms of loading speed and shader cache size, I think the last one is the best. However it may need run-time shader link before every draw call, does it affect perf a lot?
Or any better idea in GL shader cache?
Thanks