nngxUseSavedCmdlist Function

Syntax

NNGX_APICALL void NNGX_APIENTRY nngxUseSavedCmdlist(
     GLuint cmdlist,
     GLuint bufferoffset,
     GLsizei buffersize,
     GLuint requestid,
     GLsizei requestsize,
     GLbitfield statemask,
     GLboolean copycmd
);

Parameters

Name Description
in cmdlist Saved command list
in bufferoffset Save information that was obtained using the nngxStopCmdlistSave function
in buffersize Save information that was obtained using the nngxStopCmdlistSave function
in requestid Save information that was obtained using the nngxStopCmdlistSave function
in requestsize Save information that was obtained using the nngxStopCmdlistSave function
in statemask Specifies a bitwise OR of state flags for which to generate complete commands
in copycmd Specifies how the 3D command buffer is reused (either copied or referenced)

Return Values

No values are returned.

Description

Adds saved commands to the current command request.

Adds saved commands to the current command list. Set cmdlist to a saved command list. Set bufferoffset, buffersize, requestid, and requestsize to the save information obtained by the nngxStopCmdlistSave function. These specify the offset (in bytes) from the starting address for saving the 3D command buffer, the number of bytes saved, the starting ID for saving command requests, and the number of command requests saved, respectively. Always use the same set of values that you obtained from the nngxStopCmdlistSave function. The save information specified to this function is not checked for errors (whether it matches the value obtained when saving ended), so behavior is undefined if you specify invalid values.

Set statemask to a bitwise OR of state flags for which to generate complete commands. The DMPGL state and the actual PICA register settings will be in conflict after you call this function. To resolve this, you must generate all commands and reset the PICA registers. It is sometimes not necessary to generate all commands. Complete commands are generated only if they correspond to state flags specified by statemask.

You can input the following values in statemask.

NN_GX_STATE_SHADERBINARYThe shader binary state. Commands are generated for loading shader assembler code. This state is updated when the program is switched by a call to glUseProgram and each of the shader objects linked to the program object at the time of the switch are the ones loaded by individual calls to glShaderBinary.
NN_GX_STATE_SHADERPROGRAMThe shader program state. Commands are generated for configuring the structure of vertex attributes, among other things. This state is updated when the program object is switched by a call to glUseProgram. Commands are generated only for registers where settings have been changed. When validating this state, the system compares against the settings when last validated, and generates commands only for those settings that are different.
NN_GX_STATE_SHADERMODEThe shader mode state. Commands are generated for toggling whether to use the geometry shader. This state is updated when switching between using and not using the geometry shader by a call to glUseProgram.
NN_GX_STATE_SHADERFLOATThe shader floating-point state. Commands are generated for setting the floating-point registers for which values are defined by def commands in the shader assembler. This state is updated when the program object is switched to a program object for which different shader object is attached by a call to glUseProgram.
NN_GX_STATE_VSUNIFORMThe vertex shader uniform state. Commands are generated for setting the floating-point, boolean, and integer registers that are defined as uniforms in the shader assembler. This state is updated when the program object is switched by a call to glUseProgram, or when the vertex shader uniform values are set by a call to glUniform. The floating-point register uniform state is updated even when the setting is not changed. The integer register uniform state is not updated unless the setting is changed.
NN_GX_STATE_FSUNIFORMThe reserved fragment shader uniform state. Commands are generated to set the registers for the reserved fragment shader uniform. This state is updated when the uniform's values are changed, either when a program object is switched by a call to glUseProgram, or when the uniform values are changed in the fragment shader uniform setting by a call to glUniform.
NN_GX_STATE_LUTThe lookup table state. Commands are generated to set the lookup table. This state is updated when the contents are changed of the lookup table bound by calls to glBindTexture, glTexImage1D, or glTexSubImage1D; when the bound lookup table object is deleted by a call to glDeleteTextures; or when the lookup table objects specified by the lookup table ID setting uniforms are changed by calls to glUseProgram or glUniform.
NN_GX_STATE_TEXTUREThe texture state. Commands are generated for the texture unit. This excludes procedural textures. This state is updated when glBindTexture, glTexImage2D, glCompressedTexImage2D, glCopyTexImage2D, glCopyTexSubImage2D, or glTexParameter are called; when the texture object in use is deleted by a call to glDeleteTextures; or when the reserved fragment shader uniform dmp_Texture[i].samplerType is changed by a call to glUseProgram or glUniform.
NN_GX_STATE_FRAMEBUFFERThe framebuffer buffer data state. Commands are generated for the framebuffer format and buffer address. This state is updated when glBindFramebuffer, glBindFramebufferRenderbuffer, glFramebufferTexture2D, glDeleteFramebuffers, glBindRenderbuffer, glRenderbufferStorage, or glDeleteRenderbuffers are called.
NN_GX_STATE_VERTEXThe vertex attribute data state. Commands are generated for the vertex attribute data. This state is updated when glBindBuffer, glBufferData, glBufferSubData, glEnableVertexAttribArray, glDisableVertexAttribArray, glVertexAttribPointer, glVertexAttrib, or glUseProgram are called; or when the current vertex buffer is deleted by a call to glDeleteBuffers.
NN_GX_STATE_TRIOFFSETThe polygon offset state. Commands are generated for the polygon offset. This state is updated when the GL_POLYGON_OFFSET_FILL setting is changed by calls to glEnable or glDisable; when settings are changed by calls to glDepthRangef or glPolygonOffset; or when glUseProgram is called.
NN_GX_STATE_FBACCESSThe framebuffer access method state. Commands are generated for the framebuffer read/write and other access method. This state is updated when the GL_COLOR_LOGIC_OP, GL_BLEND, GL_DEPTH_TEST, GL_EARLY_DEPTH_TEST_DMP, or GL_STENCIL_TEST settings are changed by calls to glEnable or glDisable; when settings are changed by calls to glDepthFunc, glEarlyDepthFuncDMP, glColorMask, glDepthMask, or glStencilMask; or when reserved fragment shader uniform dmp_FragOperation.mode is set by a call to glUniform.
NN_GX_STATE_SCISSORThe scissoring state. Commands are generated to configure scissoring. This state is updated when the GL_SCISSOR_TEST setting is changed by calls to glEnable or glDisable; when settings are changed by calls to glScissor; or when the framebuffer size is changed when scissoring is enabled.
NN_GX_STATE_OTHERSThis state flag concerns commands generated by functions other than glDrawElements or glDrawArrays. See DMPGL Functions that Generate Commands for reference.
NN_GX_STATE_ALLThe bitwise AND of all the above statemask values.

If you set copycmd equal to GL_TRUE, the 3D command buffer is copied when commands are applied. If you set copycmd equal to GL_FALSE, the 3D command buffer is not copied when commands are applied. If the 3D command buffer is not copied, only sections that have split commands properly configured are executed. Without a split command, execution would not otherwise return from the external 3D command buffer to the current command list. Portions of the 3D command buffer not included in the render command requests are ignored. If you are using a command list without copying the 3D command buffer, you must call the nngxSplitDrawCmdlist function to add a split command before you stop saving.

If the 3D command buffer is not copied when commands are applied, the execution address will move from the 3D command buffer that is currently accumulating commands to an external 3D command buffer. The driver therefore calls the nngxSplitDrawCmdlist function to add a split command to the current 3D command buffer before it copies the command requests. The nngxSplitDrawCmdlist function is not called immediately after the current 3D command buffer is split.

When copying the 3D command buffer, when requestsize is nonzero, and the first command of the saved command requests is not a render command request, the driver calls the nngxSplitDrawCmdlist function to add a split command to the current 3D command buffer before it copies the command list. The nngxSplitDrawCmdlist function is not called immediately after the current 3D command buffer is split.

This function generates the following errors.

GL_ERROR_8037_DMP0 is bound to the current command list.
GL_ERROR_8038_DMPInvalid value specified for cmdlist
GL_ERROR_803A_DMPThis function has added saved commands past the maximum size of the current command list’s 3D command buffer and command requests.

See Also

nngxStopCmdlistSave
nngxUseSavedCmdlistNoCacheFlush

Revision History

2011/10/04
Added See Also section.
2011/08/24
Removed GL_ERROR_8039_DMP as the cmdlist parameter now supports the current command list.
2011/08/19
Added details about the statemask parameter.
2010/03/12
Initial version.

CONFIDENTIAL