Traverse-Research / gpu-allocator

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

Migrate core `gpu-allocator` crate and basic examples to `windows-rs` #107

Closed MarijnS95 closed 2 years ago

MarijnS95 commented 2 years ago

Depends on #106 Fixes #62

As has long been planned and discussed we'd like to get rid of the ancient and barely maintained winapi crate, in favour of something more modern: windows-rs is actively developed and maintained by Microsoft themselves, and generated out of header metadata rather than written by hand. Besides, it provides a more sophisticated and safer API for dealing with objects (abstracting away return types behind Result, hiding COM lifetime management, etc).

The choice for the "heavier" windows crate over windows-sys is fairly obvious: DirectX APIs are built on the COM object model which is completely unsupported in windows-sys making us unable to perform any method calls. Besides, the windows-sys crate does very little to make the API more convenient nor safer to use, effectively taking us a step back from winapi instead of a step forward.