EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

validateProgram method

Returns whether a given program can run in the current WebGL state.

IE11

 

Syntax

WebGLRenderingContext.validateProgram(program);

Parameters

program [in]

Type: WebGLProgram

The program to validate.

Return value

This method does not return a value.

Remarks

A program is considered invalid if it hasn't successfully linked, or any two active samplers in the program are different types, but refer to the same texture image unit.

This method is used in conjunction with getProgramParameter called with gl.VALIDATE_STATUS to test for a valid program.

Examples


// Assuming gl is the WebGL context object, and program is the current WebGLProgram object.
// Uses validateProgram to validate a program, then checks status.
gl.validateProgram(program);
if (!gl.getProgramParameter(program,gl.VALIDATE_STATUS){
   ... code to handle invalid program
   return;
}
// Use program if it's valid
gl.useProgram(program);

See also

WebGLRenderingContext

 

 

Afficher:
© 2014 Microsoft