mrdoob / glsl-sandbox

Shader editor and gallery.
https://glslsandbox.com/
MIT License
1.55k stars 260 forks source link

Parse errors at link time as well? #28

Open greggman opened 10 years ago

greggman commented 10 years ago

I don't think this matters but I just thought I'd point out that according to the OpenGL ES 2.0 spec a driver is allowed to always succeed at glCompileShader time as long as those errors are caught at glLinkProgram time. In other words you could do

gl.shaderSource(someShader, "bla bla bla");
gl.compileShader(someShader);
var success = gl.getShaderParameter(someShader, gl.COMPILE_STATUS);

And according to the spec it's valid for success to be true as long as later when you call gl.linkProgram and check that gl.getProgramParameter(someProgram, gl.LINK_STATUS) returns false.

I don't know of any drivers that do this, possibly some mobile drivers so it's probably not important but I just thought I'd point it out.