First; how are OpenGL shaders compiled? Are they compiled on the CPU, or the GPU, or does it vary by implementation? Do different vendors have different binary outputs; if so, is it possible to cross-compile a binary for one GPU type on another GPU? I’m developing a game that I am planning on running on Intel GFX chips, ATI cards, and NVidia cards. I would prefer to ship only the binary parts of the shaders, without having to compile the source on the client computers. Is this possible? How does the process of shader compilation work?
Share
The compilation process is, generally speaking, performed on the CPU. However, the output differs not just by vendor, but also by model. As such, the shaders must be recompiled on the user’s machine in order to remain compatible with any model of GPU the user may be using (including models of GPU that may not exist when you’re writing your game!)