On Wed, May 2, 2012 at 7:35 PM, Gregg Tavares (勤) <email@example.com> wrote:
Compile errors are returned with gl.getShaderParameter(shader, gl.COMPILE_STATUS), Link errors are returned with gl.getProgramParameter(program, gl.LINK_STATUS)Neither of those are actually an error.Also, you can compile X shaders and link Y programs all without checking the status of any of them. Which effectively means you can async compile multiple things at once. If you wanted to check them you'd need to able to check them individually, not with something like getLastError. Which one would be get getting the error for?
This is the part I didn't go into, but each getErrorAsync call would return the error as of that point. So,
var shader1 = ctx.createShader();
var shader2 = ctx.createShader();
func1 would always be called before func2; both func1 and func2 receive the value that getError would have returned if called at their respective places.
This could be done for any function that returns a value, including getProgramParameter and getShaderParameter. (That does result in a larger surface area, but I suppose this isn't unusual for the platform; actually, most web APIs have both sync and async interfaces for *all* blocking functions.)
(I'm fine with features that only help a single browser to start; that just helps encourage other browsers to improve their implementations.)But, back to the original point. I'm still not sure this is a priority.
I didn't call it a high priority; that doesn't mean it's not worth thinking about.