This document is a collection of notes regarding the methods of generating commands that can be directly interpreted by the GPU and the use of those commands together with DMPGL.
If you need more information about the direct generation of commands, see the following documentation:
glDrawArrays, glDrawElements or nngxValidateState is called.NN_GX_STATE_OTHERS state. This is a special state (explained below).Basically speaking, when a DMPGL API function is called that requires state updating, if it is possible to compare and confirm the updating of the current internal state, then the actual process of updating the internal state is carried out and the state update flag is raised.
→ In other words, when commands are directly generated without using the DMPGL API, they must not issue an update the internal state.
For the DMPGL API functions belonging to NN_GX_STATE_OTHERS, if there is an update to the internal state a command is issued and afterward the internal state is updated. (The exception is glViewport, where the command is issued without making the comparison with the internal state.)
For the API functions listed below, the update flag stands for the dependent state (NN_GX_STATE_FACES).
param is GL_COLOR_LOGIC, GL_BLEND、GL_DEPTH_TEST, GL_EARLY_DEPTH_TEST_DMP, GL_STENCIL_TESTglDepthFuncglEarlyDepthFuncDMPglColorMaskglDepthMaskglStencilMasknngxValidateState(NN_GX_STATE_ALL, *) or executed internally by glDrawArrays, glDrawElements. Due to the direct generation of commands, the register settings in the GPU and the internal states maintained in the DMPG driver layer may not be exactly the same.
In order for the GPU to correctly process the results of calls to the DMPGL API, the two must be made to match.
Broadly speaking, there are two ways of doing this before moving to the call of DMPGL API functions.
nngxUpdateState(NN_GX_STATE_ALL) and validate. This is the surest way, but you also end up issuing unnecessary commands (for registers that have already been overwritten).You can modify method (2) to suppress the redundant issuance of commands. By defining nngxSetCommandGenerationMode(NN_GX_CMDGEN_MODE_UNCONDITIONAL), commands will be issued regardless of the result of the comparison with the internal state. However, the influence of this mode is limited to the following settings. (For details, see section 4.10 in the specifications.)
NN_GX_STATE_OTHERS state.To update the state flags relating to these settings, it is no longer necessary to use nngxUpdateState.
Other notes regarding the NN_GX_STATE_OTHERS state.
NN_GX_STATE_FBACCESS raised, so they must be validated by nngxValidateState(*) and saved to cache including the command being issued.NN_GX_STATE_ALL as the argument to nngxValidateState, or if there are no other targets to validate you can just pass NN_GX_STATE_FBACCESS.By specifying NN_GX_CMDGEN_MODE_UNCONDITIONAL with nngxSetCommandGenerationMode before calling the pertinent API function, the command will be issued regardless of the result of the comparison with the internal state.
nngxUseSavedCmdlist and nngxUpdateState(NN_GX_STATE_OTHERS)If NN_GX_STATE_OTHERS has been specified for the statemask argument, the commands will be issued all at once at validation time for all API functions that result in command issuance when they themselves are called. In addition, the update bit will raise automatically for the dependent state NN_GX_STATE_FBACCESS.
CONFIDENTIAL