-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Change some image error messages to output the file path #94947
Conversation
I suggest applying the same change in RenderingDevice, so this also impacts the Forward+ and Mobile rendering methods. Otherwise, the improved error messages will only be visible when using the Compatibility rendering method. |
Also, bear in mind that (I think) not all textures will have a path (programatically created). Also, the wording of the message feels a bit werid to me. I'd suggest something like this: if (image->is_empty()) {
const String& path_str = texture->path.is_empty() ? "with no path" : vformat("with path '%s'", texture->path));
ERR_FAIL_V_MSG(Ref<Image>(), vformat("Texture (%s) has no data.
} |
Thank you both for your feedback. I updated the PR accordingly. |
I think this is good enough for now, but if may be good to refactor these blocks into something more compact, such as a (maybe templated) utility function in |
This could use a rebase and perhaps someone else from the rendering team could take a look at it, too. |
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.
Should be good to merge after squashing commits together (see PR workflow for details).
b051cdd
to
a4a26ff
Compare
Thanks! |
Test environment
Godot Engine v4.3.rc1.official
Windows 11 Pro, Version 23H2, Build 22631.3880
Issue
TextureStorage::texture_2d_get()
andTextureStorage::texture_2d_layer_get()
do not print the path of the affected texture image when they fail. This is how an example output currently looks like:This makes it hard to find and fix the affected image file.
Fix
The fix replaces some
ERR_FAIL_COND_V()
withERR_FAIL_COND_V_MSG()
to also output the file path. The output then looks like this: