retep998 / winapi-rs

Rust bindings to Windows API
https://crates.io/crates/winapi
Apache License 2.0
1.83k stars 388 forks source link

Implement Debug for descriptor structs #542

Open kvark opened 6 years ago

kvark commented 6 years ago

Things like D3D11_RASTERIZER_DESC we used to print to debug output in gfx_device_d3d11...

retep998 commented 6 years ago

Add #[debug] to the specific structs that you need Debug impls for and submit a PR.

tangmi commented 5 years ago

I've made an attempt in #760, but am unsure how to proceed with e.g. DXGI_ADAPTER_DESC::Description, which is a [WCHAR; 128] and doesn't have a derivable Debug. Ideally we can make a custom override that is something like &CStr::from_ptr(&self.Description) (and also for things like D3D11_INPUT_ELEMENT_DESC::SemanticName, which is LPCSTR), but I'm unsure how "custom" winapi-rs wants to be.

retep998 commented 5 years ago

For types which cannot derive Debug, they just won't implement Debug until someone gets const generics implemented and stabilized so that they can derive Debug.

tangmi commented 5 years ago

I think the best thing to do is remove #[debug] from DXGI_ADAPTER_DESC* and create a new issue/pr adding them that's blocked on const generics. Thoughts?