4 ms·
> for example, it will randomly recompile shaders behind your back while you are trying to have a smooth frame rate. What? I've written commercial games with o
by fooster 8y ago
> for example, it will randomly recompile shaders behind your back while you are trying to have a smooth frame rate.
What? I've written commercial games with opengl on osx/ios and my experience doesn't show that at all.
- jblow 8y agoMaybe the games were not very complex? Professional game programmers building games with lots of shaders are very familiar with what I am talking about. See for example this thread: https://www.opengl.org/discussion_boards/showthread.php/199853-Vertex-shader-in-program-2-is-being-recompiled-based-on-GL-state https://www.opengl.org/discussion_boards/showthread.php/1998...
- fulafel 8y agoAlso, you can handle caching of compiled shaders yourself now (glProgramBinary).
- 0xcde4c3db 8y agoI think the recompilations being talked about here are shaders generated by the OpenGL implementation behind your back. That is, your program never sees them as shader or program objects because they implement some permutation of blend mode, depth test, culling type, etc..
- exDM69 8y ago> What? I've written commercial games with opengl on osx/ios and my experience doesn't show that at all. State-based recompilation is a known issue in many GL drivers, particularly on mobile. E.g. changing blending settings may cause shaders to get recompiled. This can take up to a second. Some engines work around this by doing a dummy draw to an offscreen surface with all pipeline configurations that they use at init time. This (usually) guarantees that all the shaders are pre-compiled.