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 to the main menu if a shader compilation fails #14256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested and works
Also: For a better developer experience, the error message shown in the GUI should contain the actual error message from Irrlicht, not just a generic "shader compilation failed". |
Before this change, if the shaders are broken, only an error message is shown and the player enters the world nonetheless, where he/she sees broken graphics. For a shader developer, being thrown back to the main menu can be more convenient. To throw the player back to the main menu, we add an exception. Since BaseException is only catched if NDEBUG is set, we add a new exception dedicated to shaders.
Co-authored-by: grorp <gregor.parzefall@posteo.de>
3c0bda5
to
48e8fb1
Compare
How can I capture Irrlicht's error message, which arrives at |
What about this? |
Capturing the log messages from under the log subsystem only to put them into your exception text smells like a giant hack. |
It is, but less hacky approaches would require Irrlicht changes. |
I have moved the log capturing into the class but now it's a lot of code. |
The less hacky approach is to not do this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hack This reverts commit 87c6497.
I have reverted the Irrlicht message capturing change for simplicity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works. LGTM. With and without the log capturing mechanism. It could still be added later for convenience.
Before this change, if the shaders are broken, only an error message is shown and the player enters the world nonetheless, where he/she sees broken graphics. For a shader developer, being thrown back to the main menu can be more convenient.
To throw the player back to the main menu, we add an exception. Since BaseException is only catched if NDEBUG is set, we add a new exception dedicated to shaders.
Closes: #10097
Previous pull request: #10240
To do
This PR is a Ready for Review.
How to test