nngxUpdateState Function
NNGX_APICALL void NNGX_APIENTRY nngxUpdateState(
GLbitfield statemask
);
| Name | Description | |
|---|---|---|
| in | statemask | State flags to update (specified as a bitwise OR) |
Updates the specified states.
Updates the DMPGL states. Using this function to update the states will cause a complete command to be generated during validation.
The glDrawElements and glDrawArrays functions check the DMPGL state and, if it is updated, generate the relevant commands. Commands are not usually generated if the state has not been updated. If you call this function, the states will be updated, and a complete command will be scheduled for generation. This function does not itself generate commands. Call to a function such as glDrawElements or glDrawArrays after this function generates commands.
The state in which a complete command is scheduled to be generated will start when this function is called and will continue until the first call to glDrawElements or glDrawArrays. If you call the nngxValidateState function before the glDrawElements or glDrawArrays function, the commands for each validated state flag will cease to be generated.
Set statemask equal to a bitwise OR of the state flags to update.
You can input the following values in statemask.
NN_GX_STATE_SHADERBINARY | 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 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_SHADERPROGRAM | The shader program state. Commands are generated for configuring vertex attributes structure, 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_SHADERMODE | 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 glUseProgram.
|
NN_GX_STATE_SHADERFLOAT | The 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_VSUNIFORM | 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 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_FSUNIFORM | 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 glUseProgram, or when the uniform values are changed in the fragment shader uniform setting by a call to glUniform.
|
NN_GX_STATE_LUT | 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 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_TEXTURE | The 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_FRAMEBUFFER | The 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_VERTEX | The 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_TRIOFFSET | The 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_FBACCESS | The 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_SCISSOR | The scissoring state. Commands are generated for scissoring settings. 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_OTHERS | This state flag is a state specific to commands generated by functions other than glDrawElements or glDrawArrays. See DMPGL Functions that Generate Commands for reference.
|
NN_GX_STATE_ALL | The bitwise AND of all the above statemask values. |
You can use this function in combination with the nngxValidateState function to generate complete commands for each state flag.
This function will not generate any errors.
CONFIDENTIAL