-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Image loading docs are not clear enough about required feature flags #13468
Comments
I tried your example, it doesn't load exr if I don't enable |
I think ImageFormat or ExrTextureLoader are good places for such note In case of ImageFormat note should include mention of exr, hdr, basis-universal, png, dds, tga, jpeg, bmp, ktx2, webp and pnm feature |
|
@mockersf Please, help: I added attributes
and at fields
then ran command |
Worth noting that this issue is true across the board. If you have hdr enabled but not png, and try to load a .png (say, if you're writing an example for a bevy plugin that itself does not require png support), then you get a cryptic error message about the .hdr loading failing. There should probably be feature flag checks in the loader that just say "this feature is not enabled" when you try to load an image type you don't have the feature for. |
Sorry, missed your message I think you need to add |
# Objective - Add "Available on crate feature <image format> only." for docs of image format related types/functions - Add warning "WARN bevy_render::texture::image: feature "<image format>" is not enabled" on load attempt - Fixes #13468 . ## Solution - Added #[cfg(feature = "<image format>")] for types and warn!("feature \"<image format>\" is not enabled"); for ImageFormat enum conversions ## Testing ran reproducing example from issue #13468 and saw in logs `WARN bevy_render::texture::image: feature "exr" is not enabled` generated docs with command `RUSTDOCFLAGS="-Zunstable-options --cfg=docsrs" cargo +nightly doc --workspace --all-features --no-deps --document-private-items --open` and saw ![image](https://github.com/bevyengine/bevy/assets/17225606/820262bb-b4e6-4a5e-a306-bddbe9c40852) that docs contain `Available on crate feature <image format> only.` marks ![image](https://github.com/bevyengine/bevy/assets/17225606/57463440-a2ea-435f-a2c2-50d34f7f55a9) ## Migration Guide Image format related entities are feature gated, if there are compilation errors about unknown names there are some of features in list (`exr`, `hdr`, `basis-universal`, `png`, `dds`, `tga`, `jpeg`, `bmp`, `ktx2`, `webp` and `pnm`) should be added.
Bevy version
What you did
Loaded a known good
.exr
from hdri-haven withAssetServer
.What went wrong
Additional info
Here's a minimal repro, you can download a sample .exr from Poly Haven
To test, run the application, and drag and drop the .exr into the window.
The text was updated successfully, but these errors were encountered: