Examples
// `shader` was created and compiled with `createShader`.
if (!validateShader(gl, shader, 'vertex')) {
return
}Function
validateShader(gl: WebGLRenderingContext, shader: WebGLShader, label?: string): booleanChecks whether a compiled WebGL shader passed its compile-status check.
The helper reads gl.COMPILE_STATUS with
WebGLRenderingContext#getShaderParameter. If the
status is false, it logs the supplied label and the diagnostic returned by
WebGLRenderingContext#getShaderInfoLog, then returns
false. A successful check returns true without logging. Compilation
failure is reported rather than thrown; this function does not compile the
shader or alter its compilation state.
// `shader` was created and compiled with `createShader`.
if (!validateShader(gl, shader, 'vertex')) {
return
}