You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A (very) minor issue, but there is a linefeed in the getProgramInfoLog after it has been linked
Edit: Also when created it should yield a 0 length string, but instead there is a 1 length string,
with a null char. So maybe double null characters have been added?
constnodeGles=require("node-gles");constgl=nodeGles.binding.createWebGLRenderingContext();varprogram=gl.createProgram();letlog=gl.getProgramInfoLog(program);console.log(log.length,log.charCodeAt(0));constvs=`// Vertex Shadervoid main() { gl_Position = vec4(1.);}`constfs=`// Fragment shadervoid main() { gl_FragColor = vec4(1.);}`functionloadShader(gl,type,source){constshader=gl.createShader(type);gl.shaderSource(shader,source);gl.compileShader(shader);if(!gl.getShaderParameter(shader,gl.COMPILE_STATUS)){gl.deleteShader(shader);returnnull;}returnshader;}gl.attachShader(program,loadShader(gl,gl.VERTEX_SHADER,vs));gl.attachShader(program,loadShader(gl,gl.FRAGMENT_SHADER,fs));gl.linkProgram(program);if(!gl.getProgramParameter(program,gl.LINK_STATUS)){console.error('Unable to initialize the shader program: '+gl.getProgramInfoLog(program));}log=gl.getProgramInfoLog(program);console.log(log.length,log.charCodeAt(0))
yields
1 0
2 10
Which makes checks for if (log === "") fail
The text was updated successfully, but these errors were encountered:
A (very) minor issue, but there is a linefeed in the
getProgramInfoLog
after it has been linkedEdit: Also when created it should yield a 0 length string, but instead there is a 1 length string,
with a null char. So maybe double null characters have been added?
yields
Which makes checks for
if (log === "")
failThe text was updated successfully, but these errors were encountered: