Traverse-Research / gpu-allocator

🦀 GPU memory allocator for Vulkan, DirectX 12 and Metal. Written in pure Rust
https://traverse.nl/
Apache License 2.0
380 stars 50 forks source link

d3d12: Remove now-unneeded unsafe `Send`/`Sync` markers for `Allocation` and `MemoryBlock` #152

Closed MarijnS95 closed 1 year ago

MarijnS95 commented 1 year ago

Thanks to windows-rs implementing these unsafe markers for COM objects because they are declared agile (and wrapping the raw pointers in the first place, which are not marked Send/Sync by the Rust language) we can now let the compiler auto-implement the marker traits. This'll benefit safety (the traits require unsafe for a reason) in case we add fields to these structs that aren't Send/Sync in the future.

The same should be done for Vulkan at some point, by manually defining Send+Sync wrapper types around affected fields.

Also clear out MemoryType's Debug implementation which is already implemented by windows-rs.