glGetError return GL_INVALID_VALUE

Hi Experts,

In a cg code, i found a cgResetPassState call cause error in opengl
calls.
Here is my code

// Some Cg shader calls.
char lpczPassName[MAX_PASS_NAME_SIZE] = “MyPass”
CGpass pass = cgGetNamedPass( m_cgBRPTechnique, lpczPassName );
cgSetPassState( pass );

// Render code.

int nErrorValue = glGetError();
if( GL_NO_ERROR != nErrorValue )
{
OutputDebugString( _T( “Find an Error Before
cgResetPassState” ));
}}
cgResetPassState( pass );
nErrorValue = glGetError();
if( GL_NO_ERROR != nErrorValue )
{
OutputDebugString( _T( “Find an Error after
cgResetPassState” ));
}

Is there any possibility to set opengl error flag after a call to
cgResetPassState.
From its documentation, it is found that

cgResetPassState resets all of the graphics state defined in a pass by
calling the state resetting callbacks for all of the state assignments
in the pass.

But my doubt why this call cause error flag to set.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.