nngxValidateState Function
NNGX_APICALL void NNGX_APIENTRY nngxValidateState(
GLbitfield statemask,
GLboolean drawelements
);
| Name | Description | |
|---|---|---|
| in | statemask | State flag to check (specified as a bitwise OR). |
| in | drawelements | Function that performs actual rendering (either glDrawElements or glDrawArrays). |
Checks the state and generates commands.
Checks the DMPGL state and generates commands. Commands are normally accumulated in the 3D command buffer when certain DMPGL 2.0 functions are called. Most of these commands are generated by glDrawElements and glDrawArrays. DMPGL functions check the state and, if it is updated, generate the relevant commands. This is called validation. With the glDrawElements and glDrawArrays functions, most of the states are all validated at once. With this function, on the other hand, you can validate certain combinations of states.
Set statemask equal to a bitwise OR of the state flags to validate. Set drawelements to GL_TRUE when glDrawElements is called and to GL_FALSE when glDrawArrays is called for actual rendering. To validate certain states, it is sometimes necessary to know whether glDrawElements or glDrawArrays is used for rendering.
This function generates commands when the specified states have been updated. You can use this function in combination with nngxUpdateState, which updates states, to generate complete commands related to certain states.
When you use this function to generate commands for individual states, the commands may not be generated in the same order as they originally would have been using glDrawElements and glDrawArrays. Several state flags are dependent on other state flags in various ways, including the order in which the flags are specified. Behavior is undefined when there is a conflict with these dependency restrictions.
NN_GX_STATE_FBACCESS or NN_GX_STATE_TRIOFFSET must be specified before or at the same time as this function is called with the state flag NN_GX_STATE_FSUNIFORM.NN_GX_STATE_SHADERMODE must be specified before or at the same time this function is called with the state flags NN_GX_STATE_SHADERBINARY, NN_GX_STATE_SHADERPROGRAM, NN_GX_STATE_SHADERFLOAT, and NN_GX_STATE_VSUNIFORM.NN_GX_STATE_FRAMEBUFFER and NN_GX_STATE_OTHERS must be specified before or at the same time this function is called with the state flag NN_GX_STATE_FBACCESS.
If the current program object is not set (such as when 0 is specified in a call to glUseProgram), then no commands will be generated even when the states for the program and shader are validated.
Validation may result in various DMPGL errors being generated.
CONFIDENTIAL