Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieving shader errors? #642

Closed
jeffawang opened this issue Mar 3, 2022 · 3 comments
Closed

Retrieving shader errors? #642

jeffawang opened this issue Mar 3, 2022 · 3 comments

Comments

@jeffawang
Copy link

Is it possible to retrieve the shader errors for use outside of the developer console?

I want to display shader errors in my web interface for live collaborative editing. I will need the line/col position to highlight issues for user-provided code. I didn't notice an obvious way to do it in the API.

@rreusser
Copy link
Member

rreusser commented Mar 3, 2022

I believe the answer is that there is not, though this issue suggests a way to monkey-patch the error reporting method to intercept them:

#533

That's not a complete answer; I can't recall whether you can monkey patch that in regl itself or whether you have to mock console.error, but maybe that's enough to point in the right direction?

@jeffawang
Copy link
Author

I see, thanks!

For now I’m going to settle on my own webgl-based implementation, which just gives me line numbers.

Open to other ideas, but I’ll close the issue for now.

@rreusser
Copy link
Member

rreusser commented Mar 3, 2022

FWIW if you're going to the trouble of rolling your own, you might consider using WebGL 2 now that, with the release of Safari 15, support has improved significantly. As much as think regl is great to use, it gets pretty frustrating to be stuck on GL ES 1.0. @mourner wrote some nice boilerplate here which might be a good starting point. (Edit: I see technically it uses the observable license which only permits forking within observable, but if he weren't focused on much, much, much more important things at the moment, maybe the license could be changed. 🇺🇦 Or if nothing else, it's good inspiration. )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants