Shader Compilation
Shader Compilation is the process of text in the OpenGL Shading Language and loading it into OpenGL to be used as a Shader. OpenGL has three ways to compile shader text into useable OpenGL objects. All of these forms of compilation produce a Program Object.
This article is a stub. You can help the OpenGL Wiki by expanding it. |
Shader and program objects
A Program Object can contain the executable code for all of the Shader stages, such that all that is needed to render is to bind one program object. Building programs that contain multiple shader stages requires a two-stage compilation process.
This two-stage compilation process mirror the standard compile/link setup for C and C++ source code. C/C++ text is first fed through a compiler, thus producing an object file. To get the executable code, one or more object files must be linked together.
With this method of program creation, shader text is first fed through a compiler, thus producing a shader object. To get the executable program object, one or more shader objects must be linked together.
This process is done quite simply.
Shader error handling
Separate programs
Core in version | 4.6 | |
---|---|---|
Core since version | 4.1 | |
Core ARB extension | ARB_separate_shader_objects |
Program pipelines
Binary upload
Core in version | 4.6 | |
---|---|---|
Core since version | 4.1 | |
Core ARB extension | ARB_get_program_binary |