getShaderErrors method
dynamic
getShaderErrors(
- dynamic gl,
- WebGLShader shader,
- dynamic type
)
Implementation
getShaderErrors(dynamic gl, WebGLShader shader, type) {
var status = gl.getShaderParameter(shader.shader, gl.COMPILE_STATUS);
var errors = gl.getShaderInfoLog(shader.shader).trim();
if (status && errors == '') return '';
var regExp = RegExp(r"ERROR: 0:(\d+)");
var match = regExp.firstMatch( errors );
int errorLine = int.parse(match!.group(1)!);
// --enable-privileged-webgl-extension
// console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );
var source = gl.getShaderSource(shader.shader);
return 'THREE.WebGLShader: gl.getShaderInfoLog() ' +
type +
'\n' +
errors +
'\n' +
handleSource(source, errorLine);
}