Class ARBGLSPIRV
- java.lang.Object
-
- org.lwjgl.opengl.ARBGLSPIRV
-
public class ARBGLSPIRV extends java.lang.Object
Native bindings to the ARB_gl_spirv extension.This is version 100 of the GL_ARB_gl_spirv extension.
This extension does two things:
- Allows a SPIR-V module to be specified as containing a programmable shader stage, rather than using GLSL, whatever the source language was used to create the SPIR-V module.
- Modifies GLSL to be a source language for creating SPIR-V modules for OpenGL consumption. Such GLSL can be used to create such SPIR-V modules, outside of the OpenGL runtime.
Requires
OpenGL 3.3
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
GL_SHADER_BINARY_FORMAT_SPIR_V_ARB
Accepted by thebinaryformat
parameter ofShaderBinary
.static int
GL_SPIR_V_BINARY_ARB
Accepted by thepname
parameter ofGetShaderiv
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
glSpecializeShaderARB(int shader, java.lang.CharSequence pEntryPoint, int[] pConstantIndex, int[] pConstantValue)
Array version of:SpecializeShaderARB
static void
glSpecializeShaderARB(int shader, java.lang.CharSequence pEntryPoint, java.nio.IntBuffer pConstantIndex, java.nio.IntBuffer pConstantValue)
Specializes a shader created from a SPIR-V module.static void
glSpecializeShaderARB(int shader, java.nio.ByteBuffer pEntryPoint, int[] pConstantIndex, int[] pConstantValue)
Array version of:SpecializeShaderARB
static void
glSpecializeShaderARB(int shader, java.nio.ByteBuffer pEntryPoint, java.nio.IntBuffer pConstantIndex, java.nio.IntBuffer pConstantValue)
Specializes a shader created from a SPIR-V module.static void
nglSpecializeShaderARB(int shader, long pEntryPoint, int numSpecializationConstants, long pConstantIndex, long pConstantValue)
Unsafe version of:SpecializeShaderARB
-
-
-
Field Detail
-
GL_SHADER_BINARY_FORMAT_SPIR_V_ARB
Accepted by thebinaryformat
parameter ofShaderBinary
.
-
GL_SPIR_V_BINARY_ARB
Accepted by thepname
parameter ofGetShaderiv
.
-
-
Method Detail
-
nglSpecializeShaderARB
public static void nglSpecializeShaderARB(int shader, long pEntryPoint, int numSpecializationConstants, long pConstantIndex, long pConstantValue)
Unsafe version of:SpecializeShaderARB
- Parameters:
numSpecializationConstants
- the number of specialization constants whose values to set in this call
-
glSpecializeShaderARB
public static void glSpecializeShaderARB(int shader, java.nio.ByteBuffer pEntryPoint, java.nio.IntBuffer pConstantIndex, java.nio.IntBuffer pConstantValue) public static void glSpecializeShaderARB(int shader, java.lang.CharSequence pEntryPoint, java.nio.IntBuffer pConstantIndex, java.nio.IntBuffer pConstantValue)
Specializes a shader created from a SPIR-V module.Shaders associated with SPIR-V modules must be specialized before they can be linked into a program object. It is not necessary to specialize the shader before it is attached to a program object. Once specialized, a shader may not be specialized again without first re-associating the original SPIR-V module with it, through
ShaderBinary
.Specialization does two things:
- Selects the name of the entry point, for that shader’s stage, from the SPIR-V module.
- Sets the values of all, or a subset of, the specialization constants in the SPIRV module.
On successful shader specialization, the compile status for shader is set to
TRUE
. On failure, the compile status for shader is set toFALSE
and additional information about the cause of the failure may be available in the shader compilation log.- Parameters:
shader
- the name of a shader object containing unspecialized SPIR-V as created from a successful call toShaderBinary
to which a SPIR-V module was passedpEntryPoint
- a pointer to a null-terminated UTF-8 string specifying the name of the entry point in the SPIR-V module to use for this shaderpConstantIndex
- is a pointer to an array ofnumSpecializationConstants
unsigned integers, each holding the index of a specialization constant in the SPIR-V module whose value to set.Specialization constants not referenced by
pConstantIndex
retain their default values as specified in the SPIR-V module.pConstantValue
- an entry inpConstantValue
is used to set the value of the specialization constant indexed by the corresponding entry inpConstantIndex
.Although this array is of unsigned integer, each entry is bitcast to the appropriate type for the module, and therefore, floating-point constants may be set by including their IEEE-754 bit representation in the
pConstantValue
array.
-
glSpecializeShaderARB
public static void glSpecializeShaderARB(int shader, java.nio.ByteBuffer pEntryPoint, int[] pConstantIndex, int[] pConstantValue) public static void glSpecializeShaderARB(int shader, java.lang.CharSequence pEntryPoint, int[] pConstantIndex, int[] pConstantValue)
Array version of:SpecializeShaderARB
-
-