GithubHelp home page GithubHelp logo

Derive Debug for everything. about wgpu HOT 8 CLOSED

gfx-rs avatar gfx-rs commented on August 20, 2024 1
Derive Debug for everything.

from wgpu.

Comments (8)

nuew avatar nuew commented on August 20, 2024 1

The API Guidelines do suggest that every type should implement Debug, even if it doesn't give the state of all internal fields: https://rust-lang-nursery.github.io/api-guidelines/debuggability.html

from wgpu.

kvark avatar kvark commented on August 20, 2024

It does indeed appear to be addressed by #72, which takes a slightly different route (serialize instead of debug). For structures with trivially derived Debug, I don't mind to have it.

from wgpu.

kvark avatar kvark commented on August 20, 2024

@nuew thank you, that is convincing!

from wgpu.

arashikou avatar arashikou commented on August 20, 2024

Most of the public types now #[derive(Debug)]. (#216) There are a few exceptions, due to types that transitively depend on types from external crates that do not implement Debug. The plan (#218) is to submit PRs to get those types to implement Debug so we can in turn #[derive(Debug)] on wgpu's remaining types.

from wgpu.

arashikou avatar arashikou commented on August 20, 2024

Great news! It looks like @BourgondAries already did most of this work about a week ago in gfx-rs/gfx@b576335 and gfx-rs/gfx@5e9803d. So many of our types can just derive Debug once gfx-rs does another release and wgpu picks it up.

The backend instances are the sole exceptions. I'll continue tracking through the type chains to see how best to enable them to implement Debug.

from wgpu.

kvark avatar kvark commented on August 20, 2024

@arashikou here we come - gfx-rs/gfx#2817

from wgpu.

kvark avatar kvark commented on August 20, 2024

@arashikou could you update to https://crates.io/crates/gfx-hal/0.2.1 and see if adding Debug here becomes trivial?

from wgpu.

arashikou avatar arashikou commented on August 20, 2024

For most types, yes. Hub still depends on some types in the backends that aren't covered by @BourgondAries's changes, which I'm working on making implement Debug.

from wgpu.

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.