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

Improved error reporting for missing / incorrect shader #3279

Merged
merged 1 commit into from
Jun 30, 2021

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jun 30, 2021

  • when a shader (vertex or fragment) is not specified, we print error to console, and avoid crash when reporting the line number later.
  • when shader failed to compile, we skip over rendering meshes that use it to avoid flood of unrelated errors.

based on an issue reported here https://forum.playcanvas.com/t/declaration-variables-in-shaders/20906/3

@mvaligursky mvaligursky self-assigned this Jun 30, 2021
@mvaligursky mvaligursky added area: graphics Graphics related issue bug labels Jun 30, 2021
@Maksims
Copy link
Contributor

Maksims commented Jun 30, 2021

Awesome!
Also, would love to have better reporting of error code, instead of the whole shader, just perhaps 3 lines before and 3 lines after with line numbers - would be great. Otherwise, it is a lot of scrolling.

Also, please take into account a scenario where material chunks are re-applied and the shader is queued for recompile, which can lead to fixing or error (again). This workflow is really useful when writing shaders with live-reload by subscribing to the asset load event.

@mvaligursky
Copy link
Contributor Author

Good suggestion @Maksims - I get annoying by those long shaders in the errors as well. I'll create a separate issue to address.

The recompiling part should work - I believe you fixed it many months ago, and that should still work.

@mvaligursky mvaligursky merged commit 67a8fc7 into master Jun 30, 2021
@mvaligursky mvaligursky deleted the mvaligursky-null-shader branch June 30, 2021 17:57
@mvaligursky
Copy link
Contributor Author

@Maksims - issue created #3280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants