public class NVCommandList
extends java.lang.Object
This extension adds a few new features designed to provide very low overhead batching and replay of rendering commands and state changes:
Because state objects reflect the state of the entire pipeline, it is expected that they can be pre-validated and executed efficiently. It is also expected that when state objects are combined into a command list, the command list can diff consecutive state objects to produce a reduced/ optimized set of state changes specific to that transition.
The token-based command stream can also be stored in regular buffer objects and therefore be modified by the server itself. This allows more complex work creation than the original MDI approach, which was limited to emitting draw calls only.
typedef struct {
uint header;
} TerminateSequenceCommandNV;
typedef struct {
uint header;
} NOPCommandNV;
typedef struct {
uint header;
uint count;
uint firstIndex;
uint baseVertex;
} DrawElementsCommandNV;
typedef struct {
uint header;
uint count;
uint first;
} DrawArraysCommandNV;
typedef struct {
uint header;
uint mode;
uint count;
uint instanceCount;
uint firstIndex;
uint baseVertex;
uint baseInstance;
} DrawElementsInstancedCommandNV;
typedef struct {
uint header;
uint mode;
uint count;
uint instanceCount;
uint first;
uint baseInstance;
} DrawArraysInstancedCommandNV;
typedef struct {
uint header;
uint addressLo;
uint addressHi;
uint typeSizeInByte;
} ElementAddressCommandNV;
typedef struct {
uint header;
uint index;
uint addressLo;
uint addressHi;
} AttributeAddressCommandNV;
typedef struct {
uint header;
ushort index;
ushort stage;
uint addressLo;
uint addressHi;
} UniformAddressCommandNV;
typedef struct {
uint header;
float red;
float green;
float blue;
float alpha;
} BlendColorCommandNV;
typedef struct {
uint header;
uint frontStencilRef;
uint backStencilRef;
} StencilRefCommandNV;
typedef struct {
uint header;
float lineWidth;
} LineWidthCommandNV;
typedef struct {
uint header;
float scale;
float bias;
} PolygonOffsetCommandNV;
typedef struct {
uint header;
float alphaRef;
} AlphaRefCommandNV;
typedef struct {
uint header;
uint x;
uint y;
uint width;
uint height;
} ViewportCommandNV; // only ViewportIndex 0
typedef struct {
uint header;
uint x;
uint y;
uint width;
uint height;
} ScissorCommandNV; // only ViewportIndex 0
typedef struct {
uint header;
uint frontFace; // 0 for CW, 1 for CCW
} FrontFaceCommandNV;
Tight packing is used for all structures.
| Modifier and Type | Field and Description |
|---|---|
static int |
GL_ALPHA_REF_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_ATTRIBUTE_ADDRESS_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_BLEND_COLOR_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_DRAW_ARRAYS_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_DRAW_ARRAYS_STRIP_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_DRAW_ELEMENTS_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_DRAW_ELEMENTS_STRIP_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_ELEMENT_ADDRESS_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_FRONT_FACE_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_LINE_WIDTH_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_NOP_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_POLYGON_OFFSET_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_SCISSOR_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_STENCIL_REF_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_TERMINATE_SEQUENCE_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_UNIFORM_ADDRESS_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
static int |
GL_VIEWPORT_COMMAND_NV
Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
glCallCommandListNV(int list)
Executes the command list indicated by
list, which operates as if the DrawCommandsStates* commands were replayed in the order they were
enqueued on each segment, starting from segment zero and proceeding to the maximum segment. |
static void |
glCommandListSegmentsNV(int list,
int segments)
Indicates that
list will have segments number of segments, each of which is a list of command sequences that it enqueues. |
static void |
glCompileCommandListNV(int list)
Makes the list indicated by
list switch from allowing collection of commands to allowing its execution. |
static int |
glCreateCommandListsNV()
Returns
n previously unused command list names in lists, and creates a command list in the initial state for each name. |
static void |
glCreateCommandListsNV(int[] lists)
Array version of:
CreateCommandListsNV |
static void |
glCreateCommandListsNV(java.nio.IntBuffer lists)
Returns
n previously unused command list names in lists, and creates a command list in the initial state for each name. |
static int |
glCreateStatesNV()
Returns
n previously unused state object names in states, and creates a state object in the initial state for each name. |
static void |
glCreateStatesNV(int[] states)
Array version of:
CreateStatesNV |
static void |
glCreateStatesNV(java.nio.IntBuffer states)
Returns
n previously unused state object names in states, and creates a state object in the initial state for each name. |
static void |
glDeleteCommandListsNV(int list)
Deletes
n command lists stored in lists. |
static void |
glDeleteCommandListsNV(int[] lists)
Array version of:
DeleteCommandListsNV |
static void |
glDeleteCommandListsNV(java.nio.IntBuffer lists)
Deletes
n command lists stored in lists. |
static void |
glDeleteStatesNV(int state)
Deletes
n names of state objects given by states. |
static void |
glDeleteStatesNV(int[] states)
Array version of:
DeleteStatesNV |
static void |
glDeleteStatesNV(java.nio.IntBuffer states)
Deletes
n names of state objects given by states. |
static void |
glDrawCommandsAddressNV(int primitiveMode,
long[] indirects,
int[] sizes)
Array version of:
DrawCommandsAddressNV |
static void |
glDrawCommandsAddressNV(int primitiveMode,
java.nio.LongBuffer indirects,
java.nio.IntBuffer sizes)
Accepts arrays of buffer addresses as an array of GPU addresses
indirects, an array of sequence lengths in sizes. |
static void |
glDrawCommandsNV(int primitiveMode,
int buffer,
org.lwjgl.PointerBuffer indirects,
int[] sizes)
Array version of:
DrawCommandsNV |
static void |
glDrawCommandsNV(int primitiveMode,
int buffer,
org.lwjgl.PointerBuffer indirects,
java.nio.IntBuffer sizes)
Accepts arrays of buffer addresses as an array of offsets
indirects into a buffer named by buffer, an array of command lengths in
sizes. |
static void |
glDrawCommandsStatesAddressNV(long[] indirects,
int[] sizes,
int[] states,
int[] fbos)
Array version of:
DrawCommandsStatesAddressNV |
static void |
glDrawCommandsStatesAddressNV(java.nio.LongBuffer indirects,
java.nio.IntBuffer sizes,
java.nio.IntBuffer states,
java.nio.IntBuffer fbos)
Accepts arrays of buffer addresses as an array of GPU addresses
indirects, an array of command lengths in sizes, and an array of state
object names in states, of which all names must be non-zero. |
static void |
glDrawCommandsStatesNV(int buffer,
org.lwjgl.PointerBuffer indirects,
int[] sizes,
int[] states,
int[] fbos)
Array version of:
DrawCommandsStatesNV |
static void |
glDrawCommandsStatesNV(int buffer,
org.lwjgl.PointerBuffer indirects,
java.nio.IntBuffer sizes,
java.nio.IntBuffer states,
java.nio.IntBuffer fbos)
Accepts arrays of buffer addresses as an array of offsets
indirects into a buffer named by buffer, an array of command lengths in
sizes, and an array of state object names in states, of which all names must be non-zero. |
static int |
glGetCommandHeaderNV(int tokenID,
int size)
Returns the encoded 32bit header value for a given command; the returned value is implementation specific.
|
static short |
glGetStageIndexNV(int shadertype)
Returns the 16bit value for a specific shader stage; the returned value is implementation specific.
|
static boolean |
glIsCommandListNV(int list)
Returns true if the specified name corresponds to a command list.
|
static boolean |
glIsStateNV(int state)
Returns true if the specified name corresponds to a state object.
|
static void |
glListDrawCommandsStatesClientNV(int list,
int segment,
org.lwjgl.PointerBuffer indirects,
org.lwjgl.PointerBuffer sizes,
int[] states,
int[] fbos)
Array version of:
ListDrawCommandsStatesClientNV |
static void |
glListDrawCommandsStatesClientNV(int list,
int segment,
org.lwjgl.PointerBuffer indirects,
org.lwjgl.PointerBuffer sizes,
java.nio.IntBuffer states,
java.nio.IntBuffer fbos)
A list has multiple segments and each segment enqueues an ordered list of commands.
|
static void |
glStateCaptureNV(int state,
int mode)
Captures the current state of the rendering pipeline into the object indicated by
state. |
static void |
nglCreateCommandListsNV(int n,
long lists)
Unsafe version of:
CreateCommandListsNV |
static void |
nglCreateStatesNV(int n,
long states)
Unsafe version of:
CreateStatesNV |
static void |
nglDeleteCommandListsNV(int n,
long lists)
Unsafe version of:
DeleteCommandListsNV |
static void |
nglDeleteStatesNV(int n,
long states)
Unsafe version of:
DeleteStatesNV |
static void |
nglDrawCommandsAddressNV(int primitiveMode,
long indirects,
long sizes,
int count)
Unsafe version of:
DrawCommandsAddressNV |
static void |
nglDrawCommandsNV(int primitiveMode,
int buffer,
long indirects,
long sizes,
int count)
Unsafe version of:
DrawCommandsNV |
static void |
nglDrawCommandsStatesAddressNV(long indirects,
long sizes,
long states,
long fbos,
int count)
Unsafe version of:
DrawCommandsStatesAddressNV |
static void |
nglDrawCommandsStatesNV(int buffer,
long indirects,
long sizes,
long states,
long fbos,
int count)
Unsafe version of:
DrawCommandsStatesNV |
static void |
nglListDrawCommandsStatesClientNV(int list,
int segment,
long indirects,
long sizes,
long states,
long fbos,
int count)
Unsafe version of:
ListDrawCommandsStatesClientNV |
public static final int GL_TERMINATE_SEQUENCE_COMMAND_NV
public static final int GL_NOP_COMMAND_NV
public static final int GL_DRAW_ELEMENTS_COMMAND_NV
public static final int GL_DRAW_ARRAYS_COMMAND_NV
public static final int GL_DRAW_ELEMENTS_STRIP_COMMAND_NV
public static final int GL_DRAW_ARRAYS_STRIP_COMMAND_NV
public static final int GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV
public static final int GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV
public static final int GL_ELEMENT_ADDRESS_COMMAND_NV
public static final int GL_ATTRIBUTE_ADDRESS_COMMAND_NV
public static final int GL_UNIFORM_ADDRESS_COMMAND_NV
public static final int GL_BLEND_COLOR_COMMAND_NV
public static final int GL_STENCIL_REF_COMMAND_NV
public static final int GL_LINE_WIDTH_COMMAND_NV
public static final int GL_POLYGON_OFFSET_COMMAND_NV
public static final int GL_ALPHA_REF_COMMAND_NV
public static final int GL_VIEWPORT_COMMAND_NV
public static final int GL_SCISSOR_COMMAND_NV
public static final int GL_FRONT_FACE_COMMAND_NV
public static void nglCreateStatesNV(int n,
long states)
CreateStatesNVn - the number of state object names to createpublic static void glCreateStatesNV(java.nio.IntBuffer states)
n previously unused state object names in states, and creates a state object in the initial state for each name.states - the buffer in which to write the created state object namespublic static int glCreateStatesNV()
n previously unused state object names in states, and creates a state object in the initial state for each name.public static void nglDeleteStatesNV(int n,
long states)
DeleteStatesNVn - the number of state object names to deletepublic static void glDeleteStatesNV(java.nio.IntBuffer states)
n names of state objects given by states. Once a state object is deleted it has no contents and its name is again unused.
Unused names in states are silently ignored, as is the value zero.states - the buffer from which to read the state object names to deletepublic static void glDeleteStatesNV(int state)
n names of state objects given by states. Once a state object is deleted it has no contents and its name is again unused.
Unused names in states are silently ignored, as is the value zero.public static boolean glIsStateNV(int state)
state - the object name to testpublic static void glStateCaptureNV(int state,
int mode)
state.
The captured rendering state includes:
state - the state object into which to capture the current rendering statemode - the basic Begin mode that this state object must be used with. One of:POINTS | LINES | TRIANGLES | QUADS | LINES_ADJACENCY | TRIANGLES_ADJACENCY | PATCHES |
public static int glGetCommandHeaderNV(int tokenID,
int size)
tokenID - the command to query. One of:size - provided as basic consistency check, since the size of each structure is fixed and no padding is allowed. The value is the sum of the header and
the command specific structure.public static short glGetStageIndexNV(int shadertype)
UniformAddressCommandNV tokens.shadertype - the shader stage typepublic static void nglDrawCommandsNV(int primitiveMode,
int buffer,
long indirects,
long sizes,
int count)
DrawCommandsNVcount - the number of commandspublic static void glDrawCommandsNV(int primitiveMode,
int buffer,
org.lwjgl.PointerBuffer indirects,
java.nio.IntBuffer sizes)
indirects into a buffer named by buffer, an array of command lengths in
sizes. All arrays have count entries.primitiveMode - the primitive modebuffer - the buffer object nameindirects - the array of offsets into the buffersizes - the array of command lengthspublic static void nglDrawCommandsAddressNV(int primitiveMode,
long indirects,
long sizes,
int count)
DrawCommandsAddressNVcount - the number of commandspublic static void glDrawCommandsAddressNV(int primitiveMode,
java.nio.LongBuffer indirects,
java.nio.IntBuffer sizes)
indirects, an array of sequence lengths in sizes. All arrays have
count entries.primitiveMode - the primitive modeindirects - the array of GPU addresessizes - the array of command lengthspublic static void nglDrawCommandsStatesNV(int buffer,
long indirects,
long sizes,
long states,
long fbos,
int count)
DrawCommandsStatesNVcount - the number of commandspublic static void glDrawCommandsStatesNV(int buffer,
org.lwjgl.PointerBuffer indirects,
java.nio.IntBuffer sizes,
java.nio.IntBuffer states,
java.nio.IntBuffer fbos)
indirects into a buffer named by buffer, an array of command lengths in
sizes, and an array of state object names in states, of which all names must be non-zero. Frame buffer object names are stored in
fbos and can be either zero or non-zero. All arrays have count entries. The residency of textures used as attachment inside the state
object's captured fbo or the passed fbo must managed explicitly.buffer - the buffer object nameindirects - the array of offsets into the buffersizes - the array of command lengthsstates - the array of state object namesfbos - the array of framebuffer object namespublic static void nglDrawCommandsStatesAddressNV(long indirects,
long sizes,
long states,
long fbos,
int count)
DrawCommandsStatesAddressNVcount - the number of commandspublic static void glDrawCommandsStatesAddressNV(java.nio.LongBuffer indirects,
java.nio.IntBuffer sizes,
java.nio.IntBuffer states,
java.nio.IntBuffer fbos)
indirects, an array of command lengths in sizes, and an array of state
object names in states, of which all names must be non-zero. Frame buffer object names are stored in fbos and can be either zero or
non-zero. All arrays have count entries. The residency of textures used as attachment inside the state object's captured fbo or the passed fbo
must managed explicitly.indirects - the array of GPU addressessizes - the array of command lengthsstates - the array of state object namesfbos - the array of framebuffer object namespublic static void nglCreateCommandListsNV(int n,
long lists)
CreateCommandListsNVn - the number of command list names to createpublic static void glCreateCommandListsNV(java.nio.IntBuffer lists)
n previously unused command list names in lists, and creates a command list in the initial state for each name.lists - the buffer in which to return the created command list namespublic static int glCreateCommandListsNV()
n previously unused command list names in lists, and creates a command list in the initial state for each name.public static void nglDeleteCommandListsNV(int n,
long lists)
DeleteCommandListsNVn - the number of command list names to deletepublic static void glDeleteCommandListsNV(java.nio.IntBuffer lists)
n command lists stored in lists. Once a command list is deleted it has no contents and its name is again unused. Unused names
in lists are silently ignored, as is the value zero.lists - the buffer from which to read the command list names to deletepublic static void glDeleteCommandListsNV(int list)
n command lists stored in lists. Once a command list is deleted it has no contents and its name is again unused. Unused names
in lists are silently ignored, as is the value zero.public static boolean glIsCommandListNV(int list)
list - the object name to querypublic static void nglListDrawCommandsStatesClientNV(int list,
int segment,
long indirects,
long sizes,
long states,
long fbos,
int count)
ListDrawCommandsStatesClientNVcount - the number of commandspublic static void glListDrawCommandsStatesClientNV(int list,
int segment,
org.lwjgl.PointerBuffer indirects,
org.lwjgl.PointerBuffer sizes,
java.nio.IntBuffer states,
java.nio.IntBuffer fbos)
list on the segment indicated by segment.
A list has multiple segments and each segment enqueues an ordered list of command sequences. This command enqueues the equivalent of the
DrawCommandsStatesNV commands into the list indicated by list on the segment indicated by segment except that the sequence data is
copied from the sequences pointed to by the indirects pointer. The indirects pointer should point to a list of size count of
pointers, each of which should point to a command sequence.
The pre-validated state from states is saved into the command list, rather than a reference to the state object (i.e. the state objects or fbos
could be deleted and the command list would be unaffected). This includes native GPU addresses for all textures indirectly referenced through the fbos
passed or state objects' fbos attachments, therefore a recompile of the command list is required if such referenced textures change their allocation
(for example due to resizing), as well as explicit management of the residency of the textures prior CallCommandListNV.
ListDrawCommandsStatesClientNV performs a by-value copy of the indirect data based on the provided client-side pointers. In this case the content is fully immutable, while the buffer-based versions can change the content of the buffers at any later time.
list - the command listsegment - the segmentindirects - the array of GPU addressessizes - the array of command lengthsstates - the array of state object namesfbos - the array of framebuffer object namespublic static void glCommandListSegmentsNV(int list,
int segments)
list will have segments number of segments, each of which is a list of command sequences that it enqueues. This must be
called before any commands are enqueued. In the initial state, a command list has a single segment.list - the command listsegments - the number of ordered sequences of commandspublic static void glCompileCommandListNV(int list)
list switch from allowing collection of commands to allowing its execution. At this time, the implementation may
generate optimized commands to transition between states as efficiently as possible.list - the command list to compilepublic static void glCallCommandListNV(int list)
list, which operates as if the DrawCommandsStates* commands were replayed in the order they were
enqueued on each segment, starting from segment zero and proceeding to the maximum segment. All buffer or texture resources' residency must be managed
explicitly, including texture attachments of the effective fbos during list enqueuing.list - the command list to callpublic static void glCreateStatesNV(int[] states)
CreateStatesNVpublic static void glDeleteStatesNV(int[] states)
DeleteStatesNVpublic static void glDrawCommandsNV(int primitiveMode,
int buffer,
org.lwjgl.PointerBuffer indirects,
int[] sizes)
DrawCommandsNVpublic static void glDrawCommandsAddressNV(int primitiveMode,
long[] indirects,
int[] sizes)
DrawCommandsAddressNVpublic static void glDrawCommandsStatesNV(int buffer,
org.lwjgl.PointerBuffer indirects,
int[] sizes,
int[] states,
int[] fbos)
DrawCommandsStatesNVpublic static void glDrawCommandsStatesAddressNV(long[] indirects,
int[] sizes,
int[] states,
int[] fbos)
DrawCommandsStatesAddressNVpublic static void glCreateCommandListsNV(int[] lists)
CreateCommandListsNVpublic static void glDeleteCommandListsNV(int[] lists)
DeleteCommandListsNVpublic static void glListDrawCommandsStatesClientNV(int list,
int segment,
org.lwjgl.PointerBuffer indirects,
org.lwjgl.PointerBuffer sizes,
int[] states,
int[] fbos)
ListDrawCommandsStatesClientNVCopyright LWJGL. All Rights Reserved. License terms.