This extension introduces new commands to retrieve and set the binary representation of a program object. GetProgramBinary allows an application to
cache compiled and linked programs to avoid compiling and linking when used again. This may even allow the GL itself to act as an offline compiler. The
resulting program binary can be reloaded into the GL via ProgramBinary. This is a very useful path for applications that wish to remain portable by
shipping pure GLSL source shaders, yet would like to avoid the cost of compiling their shaders at runtime. Instead an application can supply its GLSL
source shaders during first application run, or even during installation. The application then compiles and links its shaders and reads back the program
binaries. On subsequent runs, only the program binaries need be supplied.
ProgramBinary may also accept binaries in vendor-specific formats produced by specialized offline compilation tools. This extension does not add any
such formats, but allows for them in further extensions. Though the level of optimization may not be identical -- the offline shader compiler may have
the luxury of more aggressive optimization at its disposal -- program binaries generated online by the GL are interchangeable with those generated
offline by an SDK tool.
Requires OpenGL 3.. Promoted to core in OpenGL 4..
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_NUM_PROGRAM_BINARY_FORMATS
Accepted by the |
| public static final int | GL_PROGRAM_BINARY_FORMATS
Accepted by the |
| public static final int | GL_PROGRAM_BINARY_LENGTH
Accepted by the |
| public static final int | GL_PROGRAM_BINARY_RETRIEVABLE_HINT
Accepted by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | ||
|---|---|---|---|
| public static void | glGetProgramBinary(int
the name of a program object whose binary representation to retrieve program, IntBuffer the address of a variable to receive the number of bytes written into length, IntBuffer binarya variable to receive a token indicating the format of the binary data returned by the GL binaryFormat, ByteBuffer an array into which the GL will return binary)program's binary representationReturns a binary representation of a program object's compiled and linked executable source. | ||
| public static void | glGetProgramBinary(int program, int[] length, int[] binaryFormat, ByteBuffer binary)
Array version of: | ||
| public static void | glProgramBinary(int
the name of a program object into which to load a program binary program, int the format of the binary data in binary binaryFormat, ByteBuffer an array containing the binary to be loaded into binary)programLoads a program object with a program binary. | ||
| public static void | glProgramParameteri(int
the name of a program object whose parameter to modify program, int the name of the parameter to modify. One of: pname, int
the new value of the parameter specified by value)pname for programSpecifies the integer value of a program object parameter. | ||
| public static void | nglGetProgramBinary(int program, int
the size of the buffer whose address is given by bufSize, long length, long binaryFormat, long binary)binaryUnsafe version of: | ||
| public static void | nglProgramBinary(int program, int binaryFormat, long binary, int
the number of bytes contained in length)binaryUnsafe version of: |
| GL_NUM_PROGRAM_BINARY_FORMATS | back to summary |
|---|---|
| public static final int GL_NUM_PROGRAM_BINARY_FORMATS Accepted by the | |
| GL_PROGRAM_BINARY_FORMATS | back to summary |
|---|---|
| public static final int GL_PROGRAM_BINARY_FORMATS Accepted by the | |
| GL_PROGRAM_BINARY_LENGTH | back to summary |
|---|---|
| public static final int GL_PROGRAM_BINARY_LENGTH Accepted by the | |
| GL_PROGRAM_BINARY_RETRIEVABLE_HINT | back to summary |
|---|---|
| public static final int GL_PROGRAM_BINARY_RETRIEVABLE_HINT Accepted by the | |
| ARBGetProgramBinary | back to summary |
|---|---|
| protected ARBGetProgramBinary() | |
| glGetProgramBinary | back to summary |
|---|---|
| public static void glGetProgramBinary(int program, IntBuffer length, IntBuffer binaryFormat, ByteBuffer binary) Returns a binary representation of a program object's compiled and linked executable source.
| |
| glGetProgramBinary | back to summary |
|---|---|
| public static void glGetProgramBinary(int program, int[] length, int[] binaryFormat, ByteBuffer binary) Array version of: | |
| glProgramBinary | back to summary |
|---|---|
| public static void glProgramBinary(int program, int binaryFormat, ByteBuffer binary) Loads a program object with a program binary.
| |
| glProgramParameteri | back to summary | ||
|---|---|---|---|
| public static void glProgramParameteri(int program, int pname, int value) Specifies the integer value of a program object parameter.
| |||
| nglGetProgramBinary | back to summary |
|---|---|
| public static void nglGetProgramBinary(int program, int bufSize, long length, long binaryFormat, long binary) Unsafe version of:
| |
| nglProgramBinary | back to summary |
|---|---|
| public static void nglProgramBinary(int program, int binaryFormat, long binary, int length) Unsafe version of:
| |