Click or drag to resize

ProgramValidate Method

Validates the program.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public bool Validate()

Return Value

Type: Boolean
In Release builds: True on success, False on failure. In Debug builds: True on success or an GLException will be thrown on failure.
Exceptions
ExceptionCondition
ShaderExceptionWith any validation errors.
Remarks
This method checks to see whether the executables contained in program can execute given the current OpenGL state. The validation information (exception message) may consist of an empty string, or it may be a string containing information about how the current program object interacts with the rest of current OpenGL state. This provides a way for OpenGL implementers to convey more information about why the current program is inefficient, suboptimal, failing to execute, and so on.

If validation is successful, the program is guaranteed to execute given the current state. Otherwise, the program is guaranteed to not execute.

This function is typically useful only during application development. The informational string stored in the exception message is completely implementation dependent; therefore, an application should not expect different OpenGL implementations to produce identical information strings.

Note: this function mimics the validation operation that OpenGL implementations must perform when rendering commands are issued while programmable shaders are part of current state. The error InvalidOperation will be generated by DrawArrays(glPrimitiveType, Int32) or DrawElements(glPrimitiveType, Byte) if any two active samplers in the current program object are of different types, but refer to the same texture image unit.

Note: it may be difficult or cause a performance degradation for applications to catch these errors when rendering commands are issued. Therefore, applications are advised to make calls to Validate to detect these issues during application development.

OpenGL API: glValidateProgram, glGetProgramInfoLog, glGetProgramiv(GL_VALIDATE_STATUS/GL_INFO_LOG_LENGTH)

See Also