Spector.js icon indicating copy to clipboard operation
Spector.js copied to clipboard

Report WebGL errors

Open JannikGM opened this issue 2 years ago • 2 comments

Hacky prototype for #280; expecting many changes before merge-ready

JannikGM avatar Aug 23 '23 15:08 JannikGM

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.

sebavan avatar Aug 30 '23 21:08 sebavan

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.

JannikGM avatar Sep 04 '23 09:09 JannikGM