Shader compile errors Shader compile errors google-chrome google-chrome

Shader compile errors


gl.getError only returns errors for the OpenGL pipeline. A shader failing to compile does not cause an error in the pipeline. You can read about gl.getError here. You can query the status of shader like so:

var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);console.log('Shader compiled successfully: ' + compiled);var compilationLog = gl.getShaderInfoLog(shader);console.log('Shader compiler log: ' + compilationLog);

Similarly, shader program linking errors do not invalidate the OpenGL pipeline and can't be detected with gl.getError() you must call the object (shader, program, render buffer, etc) specific error query functions.