1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../css/manpage.css" type="text/css" />
7<title>nngxUseSavedCmdlist</title>
8  </head>
9  <body>
10<h1><CODE>nngxUseSavedCmdlist</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14NNGX_APICALL void NNGX_APIENTRY nngxUseSavedCmdlist(
15     GLuint cmdlist,
16     GLuint bufferoffset,
17     GLsizei buffersize,
18     GLuint requestid,
19     GLsizei requestsize,
20     GLbitfield statemask,
21     GLboolean copycmd
22);
23</pre>
24    </div>
25<h2>Arguments</h2>
26    <div class="section">
27      <table class="arguments">
28        <thead>
29          <tr>
30            <td width="15" />
31<th>Name</th>
32<td>Description</td>
33          </tr>
34        </thead>
35        <tr>
36<td>in</td>
37<th>cmdlist</th>
38<td>Saved command list</td>
39        </tr>
40        <tr>
41<td>in</td>
42<th>bufferoffset</th>
43<td>Save information that was obtained using the <CODE>nngxStopCmdlistSave</CODE> function</td>
44        </tr>
45        <tr>
46<td>in</td>
47<th>buffersize</th>
48<td>Save information that was obtained using the <CODE>nngxStopCmdlistSave</CODE> function</td>
49        </tr>
50        <tr>
51<td>in</td>
52<th>requestid</th>
53<td>Save information that was obtained using the <CODE>nngxStopCmdlistSave</CODE> function</td>
54        </tr>
55        <tr>
56<td>in</td>
57<th>requestsize</th>
58<td>Save information that was obtained using the <CODE>nngxStopCmdlistSave</CODE> function</td>
59        </tr>
60        <tr>
61<td>in</td>
62<th>statemask</th>
63<td>Specifies a bitwise OR of state flags for which to generate complete commands</td>
64        </tr>
65        <tr>
66<td>in</td>
67<th>copycmd</th>
68<td>Specifies how the 3D command buffer is reused (either copied or referenced)</td>
69        </tr> </table>
70    </div>
71<h2>Return Values</h2>
72<div class="section">No values are returned. </div>
73<h2>Description</h2>
74    <div class="section">
75<p>Adds saved commands to the current command request.</p><P>
76Adds saved commands to the current command list. Set <SPAN class="argument">cmdlist</SPAN> to a saved command list. Set <SPAN class="argument">bufferoffset</SPAN>, <SPAN class="argument">buffersize</SPAN>, <SPAN class="argument">requestid</SPAN>, and <SPAN class="argument">requestsize</SPAN> to the save information obtained by the <CODE><a href="../nn_gx/nngxStopCmdlistSave.html">nngxStopCmdlistSave</a></CODE> 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 <CODE><a href="../nn_gx/nngxStopCmdlistSave.html">nngxStopCmdlistSave</a></CODE> 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.
77            </P><P>
78Set <SPAN class="argument">statemask</SPAN> 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 <SPAN class="argument">statemask</SPAN>.
79            </P><P>
80You can input the following values in <SPAN class="argument">statemask</SPAN>.
81<TABLE><TR><TH><CODE>NN_GX_STATE_SHADERBINARY</CODE></TH><TD>The shader binary state. Commands are generated for loading shader assembler code. This state is updated when the program is switched by a call to <CODE>glUseProgram</CODE> 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 <CODE>glShaderBinary</CODE>.
82</TD></TR><TR><TH><CODE>NN_GX_STATE_SHADERPROGRAM</CODE></TH><TD>The 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 <CODE>glUseProgram</CODE>. 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.
83</TD></TR><TR><TH><CODE>NN_GX_STATE_SHADERMODE</CODE></TH><TD>The 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 <CODE>glUseProgram</CODE>.
84</TD></TR><TR><TH><CODE>NN_GX_STATE_SHADERFLOAT</CODE></TH><TD>The shader floating-point state. Commands are generated for setting the floating-point registers for which values are defined by <CODE>def</CODE> 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 <CODE>glUseProgram</CODE>.
85</TD></TR><TR><TH><CODE>NN_GX_STATE_VSUNIFORM</CODE></TH><TD>The 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 <CODE>glUseProgram</CODE>, or when the vertex shader uniform values are set by a call to <CODE>glUniform</CODE>. 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.
86</TD></TR><TR><TH><CODE>NN_GX_STATE_FSUNIFORM</CODE></TH><TD>The 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 <CODE>glUseProgram</CODE>, or when the uniform values are changed in the fragment shader uniform setting by a call to <CODE>glUniform</CODE>.
87</TD></TR><TR><TH><CODE>NN_GX_STATE_LUT</CODE></TH><TD>The 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 <CODE>glBindTexture</CODE>, <CODE>glTexImage1D</CODE>, or <CODE>glTexSubImage1D</CODE>; when the bound lookup table object is deleted by a call to <CODE>glDeleteTextures</CODE>; or when the lookup table objects specified by the lookup table ID setting uniforms are changed by calls to <CODE>glUseProgram</CODE> or <CODE>glUniform</CODE>.
88</TD></TR><TR><TH><CODE>NN_GX_STATE_TEXTURE</CODE></TH><TD>The texture state. Commands are generated for the texture unit. This excludes procedural textures. This state is updated when <CODE>glBindTexture</CODE>, <CODE>glTexImage2D</CODE>, <CODE>glCompressedTexImage2D</CODE>, <CODE>glCopyTexImage2D</CODE>, <CODE>glCopyTexSubImage2D</CODE>, or <CODE>glTexParameter</CODE> are called; when the texture object in use is deleted by a call to <CODE>glDeleteTextures</CODE>; or when the reserved fragment shader uniform <CODE>dmp_Texture[i].samplerType</CODE> is changed by a call to <CODE>glUseProgram</CODE> or <CODE>glUniform</CODE>.
89</TD></TR><TR><TH><CODE>NN_GX_STATE_FRAMEBUFFER</CODE></TH><TD>The framebuffer buffer data state. Commands are generated for the framebuffer format and buffer address. This state is updated when <CODE>glBindFramebuffer</CODE>, <CODE>glBindFramebufferRenderbuffer</CODE>, <CODE>glFramebufferTexture2D</CODE>, <CODE>glDeleteFramebuffers</CODE>,  <CODE>glBindRenderbuffer</CODE>, <CODE>glRenderbufferStorage</CODE>, or <CODE>glDeleteRenderbuffers</CODE> are called.
90</TD></TR><TR><TH><CODE>NN_GX_STATE_VERTEX</CODE></TH><TD>The vertex attribute data state. Commands are generated for the vertex attribute data. This state is updated when <CODE>glBindBuffer</CODE>, <CODE>glBufferData</CODE>, <CODE>glBufferSubData</CODE>, <CODE>glEnableVertexAttribArray</CODE>, <CODE>glDisableVertexAttribArray</CODE>, <CODE>glVertexAttribPointer</CODE>, <CODE>glVertexAttrib</CODE>, or <CODE>glUseProgram</CODE> are called; or when the current vertex buffer is deleted by a call to <CODE>glDeleteBuffers</CODE>.
91</TD></TR><TR><TH><CODE>NN_GX_STATE_TRIOFFSET</CODE></TH><TD>The polygon offset state. Commands are generated for the polygon offset. This state is updated when the <CODE>GL_POLYGON_OFFSET_FILL</CODE> setting is changed by calls to <CODE>glEnable</CODE> or <CODE>glDisable</CODE>; when settings are changed by calls to <CODE>glDepthRangef</CODE> or <CODE>glPolygonOffset</CODE>; or when <CODE>glUseProgram</CODE> is called.
92</TD></TR><TR><TH><CODE>NN_GX_STATE_FBACCESS</CODE></TH><TD>The framebuffer access method state. Commands are generated for the framebuffer read/write and other access method. This state is updated when the <CODE>GL_COLOR_LOGIC_OP</CODE>, <CODE>GL_BLEND</CODE>, <CODE>GL_DEPTH_TEST</CODE>, <CODE>GL_EARLY_DEPTH_TEST_DMP</CODE>, or <CODE>GL_STENCIL_TEST</CODE> settings are changed by calls to <CODE>glEnable</CODE> or <CODE>glDisable</CODE>; when settings are changed by calls to <CODE>glDepthFunc</CODE>, <CODE>glEarlyDepthFuncDMP</CODE>, <CODE>glColorMask</CODE>, <CODE>glDepthMask</CODE>, or <CODE>glStencilMask</CODE>; or when reserved fragment shader uniform <CODE>dmp_FragOperation.mode</CODE> is set by a call to <CODE>glUniform</CODE>.
93</TD></TR><TR><TH><CODE>NN_GX_STATE_SCISSOR</CODE></TH><TD>The scissoring state. Commands are generated to configure scissoring. This state is updated when the <CODE>GL_SCISSOR_TEST</CODE> setting is changed by calls to <CODE>glEnable</CODE> or <CODE>glDisable</CODE>; when settings are changed by calls to <CODE>glScissor</CODE>; or when the framebuffer size is changed when scissoring is enabled.
94</TD></TR><TR><TH><CODE>NN_GX_STATE_OTHERS</CODE></TH><TD>This state flag concerns commands generated by functions other than <CODE>glDrawElements</CODE> or <CODE>glDrawArrays</CODE>. See <I>DMPGL Functions that Generate Commands</I> for reference.
95</TD></TR><TR><TH><CODE>NN_GX_STATE_ALL</CODE></TH><TD>The bitwise AND of all the above <SPAN class="argument">statemask</SPAN> values.
96                    </TD></TR></TABLE></P><P>
97If you set <SPAN class="argument">copycmd</SPAN> equal to <CODE>GL_TRUE</CODE>, the 3D command buffer is copied when commands are applied. If you set <SPAN class="argument">copycmd</SPAN> equal to <CODE>GL_FALSE</CODE>, 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 <CODE><a href="../nn_gx/nngxSplitDrawCmdlist.html">nngxSplitDrawCmdlist</a></CODE> function to add a split command before you stop saving.
98            </P><P>
99If 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 <CODE><a href="../nn_gx/nngxSplitDrawCmdlist.html">nngxSplitDrawCmdlist</a></CODE> function to add a split command to the current 3D command buffer before it copies the command requests. The <CODE><a href="../nn_gx/nngxSplitDrawCmdlist.html">nngxSplitDrawCmdlist</a></CODE> function is not called immediately after the current 3D command buffer is split.
100            </P><P>
101When copying the 3D command buffer, when <SPAN class="argument">requestsize</SPAN> is nonzero, and the first command of the saved command requests is not a render command request, the driver calls the <CODE><a href="../nn_gx/nngxSplitDrawCmdlist.html">nngxSplitDrawCmdlist</a></CODE> function to add a split command to the current 3D command buffer before it copies the command list. The <CODE><a href="../nn_gx/nngxSplitDrawCmdlist.html">nngxSplitDrawCmdlist</a></CODE> function is not called immediately after the current 3D command buffer is split.
102            </P><P>
103This function generates the following errors.
104<TABLE><TR><TH>GL_ERROR_8037_DMP</TH><TD>0 is bound to the current command list.</TD></TR><TR><TH>GL_ERROR_8038_DMP</TH><TD>Invalid value specified for <SPAN class="argument">cmdlist</SPAN></TD></TR><TR><TH>GL_ERROR_803A_DMP</TH><TD>This function has added saved commands past the maximum size of the current command list&rsquo;s 3D command buffer and command requests.</TD></TR></TABLE></P></div>
105<h2>See Also</h2>
106    <div class="section">
107<p class="reference"><a href="../nn_gx/nngxStopCmdlistSave.html"><CODE>nngxStopCmdlistSave</CODE></a><br /><a href="../nn_gx/nngxUseSavedCmdlistNoCacheFlush.html"><CODE>nngxUseSavedCmdlistNoCacheFlush</CODE></a><br /> </p>
108    </div>
109<h2>Revision History</h2>
110    <div class="section">
111      <dl class="history">
112        <dt>2011/10/04</dt>
113<dd>Added <B>See Also</B> section.<br />
114        </dd>
115        <dt>2011/08/24</dt>
116<dd>Removed <CODE>GL_ERROR_8039_DMP</CODE> as the <SPAN class="argument">cmdlist</SPAN> parameter now supports the current command list.
117        </dd>
118        <dt>2011/08/19</dt>
119<dd>Added details about the <SPAN class="argument">statemask</SPAN> parameter.
120        </dd>
121        <dt>2010/03/12</dt>
122<dd>Initial version.<br />
123        </dd>
124      </dl>
125    </div>
126  <hr><p>CONFIDENTIAL</p></body>
127</html>