From time to time people say that they want support for precompiled shaders in the OpenGL API. The main point for this they bring forth is reducing loading times for their applications.
I think this advantage of precompiled shaders can be had without support for it in the API: It can be inmplemented transparently in the driver.
When the application passes a shader source to be compiled to the driver the driver calculates a cryptographic hash of the source and relevant settings such a some hints. The driver then looks into it’s cache of compiled shaders for one with the same hash value. If there is one, use it - no need to compile the source again. If there is none, compile it, store it in the cache along with the hash value.
There is no additional work for the application programmers to do. They will automatically receive the benefit of faster application startup. The driver knows best when it has to recompile (e.g. after a driver update). The cache size is expected to be rather small, and today’s hard-disks are large.
The cryptographic hash ensures that no application will intentionally or accidently use shaders from another application.
Let the driver do the compiled shader caching instead of burdening API and application with it!