Compiled Shader Program Characteristics

The resulting program binary only functions correctly with the version of the driver with which the compiler was released.

The format of a compiled program binary is:

  • 4 bytes containing the size of the program binary
  • 4 bytes containing the format of the program binary
  • A variable number of bytes containing the program data

These should be passed as the 4th, 2nd, and 3rd arguments, respectively, of glProgramBinary. See the gearslib.c file for more details on loading shader programs.

After a successful compilation, glslc displays the following message:

Program binary successfully written to <binary file name>

The size and format of a program binary produced by glslc are expected to match the size and format of a program binary produced by the GL driver via a glGetProgramBinary call.