Open cshenton-work opened 1 month ago
I tried your example, it doesn't load exr if I don't enable exr
feature
bevy = { version = "0.13.2" }
But if enable it, example doesn't print any error
bevy = { version = "0.13.2", features = ["exr"] }
@cshenton-work That because this feature affects loader initialization here
@alice-i-cecile Do we need make some note in docs anywere or we should just close issue?
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
#[cfg_attr(docsrs, doc(cfg(feature = "exr")))]
on what is behind the feature should mark it in docs.rs
https://github.com/rust-lang/rust/issues/43781
@mockersf Please, help: I added attributes
/// Loads EXR textures as Texture assets
#[derive(Clone, Default)]
#[cfg(feature = "exr")]
#[cfg_attr(docsrs, doc(cfg(feature = "exr")))]
pub struct ExrTextureLoader;
and at fields
Gif,
#[cfg_attr(docsrs, doc(cfg(feature = "exr")))]
OpenExr,
then ran command
cargo doc --workspace --all-features --no-deps --document-private-items --open
and saw that nothing changes
What did I wrong? Or maybe this rustdoc feature is not ready yet?
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.
@mockersf Please, help: I added attributes
What did I wrong? Or maybe this rustdoc feature is not ready yet?
Sorry, missed your message
I think you need to add RUSTDOCFLAGS: -Zunstable-options --cfg=docsrs
as an environment variable to build docs as docs.rs, and use a nightly version of rust
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.