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

⚠️ NOTICE for `metal` users on `gpu-allocator 0.26` ⚠️ #224

Closed MarijnS95 closed 1 month ago

MarijnS95 commented 6 months ago

gpu-allocator 0.26 was just published with metal support! Unfortunately the metal-rs crate that is used is heavily unmaintained, and some functions used by gpu-allocator are not yet available in the upstream metal-rs release. Attempts to contribute have thus far gone unnoticed.

This was worked around by a patch in Cargo.toml which does not translate to the crates.io release, so anyone turning on the not-default metal feature will get a compilation failure in gpu-allocator.

The workaround is to adopt the same [patch.crates-io] into your workspace root, while we work to resolve this issue upstream:

https://github.com/Traverse-Research/gpu-allocator/blob/cbf52992b972c6cba6b1ba0530197642614b4154/Cargo.toml#L100-L101

MarijnS95 commented 6 months ago

A planned upgrade to objc2 and objc2-metal is happening in https://github.com/Traverse-Research/gpu-allocator/pull/225 :tada:

MarijnS95 commented 1 month ago

This was fixed by using stable metal 0.29 complete will all necessary changes in the published gpu-allocator 0.27 release.

Jasper-Bekkers commented 1 month ago

For any users upgrading that are still on metal-rs, it's relatively trivial to unsafely transmute the structures back and forth as a stopgap solution.

MarijnS95 commented 1 month ago

Note that the metal-rs -> objc2 conversion will only come in the gpu-allocator 0.28 release, so you can also stick around on the older version for a little bit while still benefiting from the fix for this issue in the current-latest 0.27 release.