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

Custom handler for shader compile/link errors #162

Open
lucasdomanico opened this issue Nov 14, 2019 · 3 comments
Open

Custom handler for shader compile/link errors #162

lucasdomanico opened this issue Nov 14, 2019 · 3 comments

Comments

@lucasdomanico
Copy link

Hello!, this is about a tiny feature request; I'm currently modifying Shader.checkCompilation() source code, to handle these errors in the way I need.
It would be cool if PicoGL had a way to set a handler for compilation errors.
Best regards,

@tsherif
Copy link
Owner

tsherif commented Oct 22, 2020

@lucasdomanico sorry for the late reply. Is this still an issue? This might be doable, but I'd like to understand the use-case better. Shader compilation errors are generally programming errors, so I'm not clear on what a runtime handler would be able to do.

@lucasdomanico
Copy link
Author

Hi again!
This problem arises in my app when a shader uses an internal glsl library.
I want to skip the error lines from this library (around 1000 LOC) and only show the "client" shader errors.
I understand this is a bit narrow so hacking the source might be fine.

Another option is to throw an exception instead of writing directly to the console.error

@tsherif
Copy link
Owner

tsherif commented Oct 24, 2020

That could make sense. I'd probably do something like App.onProgramError((program, vShader, fShader) => {...}) with the default behavior being the current dump to console.

@tsherif tsherif changed the title Shader.checkCompilation Handler Custom handler for shader compile/link errors Oct 24, 2020
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