Class ARBGetProgramBinary
- java.lang.Object
-
- org.lwjgl.opengl.ARBGetProgramBinary
-
public class ARBGetProgramBinary extends java.lang.Object
Native bindings to the ARB_get_program_binary extension.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 viaProgramBinary
. 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.0
. Promoted to core inOpenGL 4.1
.
-
-
Field Summary
Fields Modifier and Type Field and Description static int
GL_NUM_PROGRAM_BINARY_FORMATS
GL_PROGRAM_BINARY_FORMATSAccepted by thepname
parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev.static int
GL_PROGRAM_BINARY_LENGTH
Accepted by thepname
parameter of GetProgramiv.static int
GL_PROGRAM_BINARY_RETRIEVABLE_HINT
Accepted by thepname
parameter of ProgramParameteri and GetProgramiv.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
glGetProgramBinary(int program, int[] length, int[] binaryFormat, java.nio.ByteBuffer binary)
Array version of:GetProgramBinary
static void
glGetProgramBinary(int program, java.nio.IntBuffer length, java.nio.IntBuffer binaryFormat, java.nio.ByteBuffer binary)
Returns a binary representation of a program object's compiled and linked executable source.static void
glProgramBinary(int program, int binaryFormat, java.nio.ByteBuffer binary)
Loads a program object with a program binary.static void
glProgramParameteri(int program, int pname, int value)
Specifies the integer value of a program object parameter.
-
-
-
Field Detail
-
GL_PROGRAM_BINARY_RETRIEVABLE_HINT
Accepted by thepname
parameter of ProgramParameteri and GetProgramiv.
-
GL_PROGRAM_BINARY_LENGTH
Accepted by thepname
parameter of GetProgramiv.
-
GL_NUM_PROGRAM_BINARY_FORMATS, GL_PROGRAM_BINARY_FORMATS
Accepted by thepname
parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev.
-
-
Method Detail
-
glGetProgramBinary
public static void glGetProgramBinary(int program, java.nio.IntBuffer length, java.nio.IntBuffer binaryFormat, java.nio.ByteBuffer binary)
Returns a binary representation of a program object's compiled and linked executable source.- Parameters:
program
- the name of a program object whose binary representation to retrievelength
- the address of a variable to receive the number of bytes written intobinary
binaryFormat
- a variable to receive a token indicating the format of the binary data returned by the GLbinary
- an array into which the GL will returnprogram
's binary representation
-
glProgramBinary
public static void glProgramBinary(int program, int binaryFormat, java.nio.ByteBuffer binary)
Loads a program object with a program binary.- Parameters:
program
- the name of a program object into which to load a program binarybinaryFormat
- the format of the binary data in binarybinary
- an array containing the binary to be loaded intoprogram
-
glProgramParameteri
public static void glProgramParameteri(int program, int pname, int value)
Specifies the integer value of a program object parameter.- Parameters:
program
- the name of a program object whose parameter to modifypname
- the name of the parameter to modify. One of:PROGRAM_BINARY_RETRIEVABLE_HINT
PROGRAM_SEPARABLE
value
- the new value of the parameter specified bypname
forprogram
-
glGetProgramBinary
public static void glGetProgramBinary(int program, int[] length, int[] binaryFormat, java.nio.ByteBuffer binary)
Array version of:GetProgramBinary
-
-