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

Return original source if preprocessor fails #4285

Merged
merged 2 commits into from
May 30, 2022

Conversation

slimbuck
Copy link
Member

It seems a little safer to return the original shader source if preprocessing fails (rather than null) since the shader may still be valid.

Debug build of the engine outputs the details needed to debug failing shader.

@slimbuck slimbuck added enhancement area: graphics Graphics related issue labels May 30, 2022
@slimbuck slimbuck requested a review from a team May 30, 2022 14:07
@slimbuck slimbuck self-assigned this May 30, 2022
@mvaligursky
Copy link
Contributor

It is safer for now, but when we implement uniform buffers or other features which depend on it, it won't work at all. So I would prefer we return null.

@slimbuck
Copy link
Member Author

The problem with returning null right now is that you only get feedback in debug build. The shader currently fails to compile without any context (since shader = null). At least a failing shader in future will print context, because there will be a shader printout. (And of course in debug build you'll also hopefully get preprocessor errors).

@slimbuck slimbuck merged commit 88566de into playcanvas:main May 30, 2022
@slimbuck slimbuck deleted the preprocess-error branch May 30, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants