GithubHelp home page GithubHelp logo

Comments (6)

cshenton-work avatar cshenton-work commented on June 29, 2024 2

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.

from bevy.

mockersf avatar mockersf commented on June 29, 2024 1

#[cfg_attr(docsrs, doc(cfg(feature = "exr")))] on what is behind the feature should mark it in docs.rs
rust-lang/rust#43781

from bevy.

bugsweeper avatar bugsweeper commented on June 29, 2024

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?

from bevy.

bugsweeper avatar bugsweeper commented on June 29, 2024

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

from bevy.

bugsweeper avatar bugsweeper commented on June 29, 2024

@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
image
image
What did I wrong? Or maybe this rustdoc feature is not ready yet?

from bevy.

mockersf avatar mockersf commented on June 29, 2024

@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

from bevy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.