Spector.js
Spector.js copied to clipboard
Report WebGL errors
Hacky prototype for #280; expecting many changes before merge-ready
Let me move as draft for now.
I honestly never though of Spector to troubleshoot those kind of errors as most of the info are only available in browsers console. This would only provide a tiny subset of the errors at the expense of a huge perf it plus modifying the app flow by consuming the error on our side which might have weird unexpected side effects with the app thinking it is all good.
I honestly never though of Spector to troubleshoot those kind of errors ...
This is a common feature of these API tracing tools / graphics debuggers.
... as most of the info are only available in browsers console.
I don't think I've seen this feature (GL error reporting in devtools) yet? I only get such warnings from graphics middleware or when using external debugging tools. However, I don't get it in a timeline like Spector.js provides (where I can see error reports interleaved with graphics output).
This would only provide a tiny subset of the errors
What other errors would there be, other than logic?
a huge perf [h]it
I don't think the perf hit is that bad (compared to dumping the framebuffer or textures). However, I also think it should be an optional "Validate" or "Check for errors" checkbox for tracing.
modifying the app flow by consuming the error on our side which might have weird unexpected side effects with the app thinking it is all good.
There's actually a Khronos reference implementation for a feature like this: https://www.khronos.org/webgl/wiki/Debugging#Programmatically_Debugging_WebGL_applications (which my implementation doesn't follow). Even if it's not 100% faithful to what the browser or driver might do, such implementations still follow the WebGL spec.