Skip to content

Commit 723eff5

Browse files
committedFeb 3, 2025
Remove stale and UB winapi compatibility layer
With the `windows` migration we introduced a `winapi` compatibility layer to make it easier to use `winapi` types with `gpu-allocator`. As most of the ecosystem has switched to `windows` it is now time to sunset these helpers which are otherwise tedious to test and maintain, not to mention contain long(er) standing unsoundness bugs.
1 parent ba9a268 commit 723eff5

File tree

6 files changed

+9
-434
lines changed

6 files changed

+9
-434
lines changed
 

‎.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- os: ubuntu-latest
3333
features: vulkan,visualizer
3434
- os: windows-latest
35-
features: vulkan,visualizer,d3d12,public-winapi
35+
features: vulkan,visualizer,d3d12
3636
- os: macos-latest
3737
features: vulkan,visualizer,metal
3838
runs-on: ${{ matrix.os }}
@@ -59,7 +59,7 @@ jobs:
5959
- os: ubuntu-latest
6060
features: vulkan,visualizer
6161
- os: windows-latest
62-
features: vulkan,visualizer,d3d12,public-winapi
62+
features: vulkan,visualizer,d3d12
6363
- os: macos-latest
6464
features: vulkan,visualizer,metal
6565
runs-on: ${{ matrix.os }}

‎Cargo.toml

-13
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ objc2-metal = { version = "0.3", default-features = false, features = [
4747
"std",
4848
], optional = true }
4949

50-
[target.'cfg(windows)'.dependencies]
51-
# Only needed for public-winapi interop helpers
52-
winapi = { version = "0.3.9", features = ["d3d12", "winerror", "impl-default", "impl-debug"], optional = true }
53-
5450
[target.'cfg(windows)'.dependencies.windows]
5551
version = ">=0.53,<=0.59"
5652
features = [
@@ -64,9 +60,6 @@ optional = true
6460
ash = { version = "0.38", default-features = false, features = ["debug", "loaded"] }
6561
env_logger = "0.10"
6662

67-
[target.'cfg(windows)'.dev-dependencies]
68-
winapi = { version = "0.3.9", features = ["d3d12", "d3d12sdklayers", "dxgi1_6", "winerror", "impl-default", "impl-debug", "winuser", "windowsx", "libloaderapi"] }
69-
7063
[target.'cfg(windows)'.dev-dependencies.windows]
7164
# API-breaks since Windows 0.58 only affect our examples
7265
version = ">=0.58,<=0.59"
@@ -85,10 +78,6 @@ objc2-metal = { version = "0.3", default-features = false, features = [
8578
name = "vulkan-buffer"
8679
required-features = ["vulkan", "ash/loaded"]
8780

88-
[[example]]
89-
name = "d3d12-buffer"
90-
required-features = ["d3d12", "public-winapi"]
91-
9281
[[example]]
9382
name = "d3d12-buffer-winrs"
9483
required-features = ["d3d12"]
@@ -102,7 +91,5 @@ visualizer = ["dep:egui", "dep:egui_extras"]
10291
vulkan = ["dep:ash"]
10392
d3d12 = ["dep:windows"]
10493
metal = ["dep:objc2", "dep:objc2-metal", "dep:objc2-foundation"]
105-
# Expose helper functionality for winapi types to interface with gpu-allocator, which is primarily windows-rs driven
106-
public-winapi = ["dep:winapi"]
10794

10895
default = ["d3d12", "vulkan", "metal"]

‎README.md

-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ gpu-allocator = "0.27.0"
1919

2020
This crate provides a fully written in Rust memory allocator for Vulkan, DirectX 12 and Metal.
2121

22-
## [Windows-rs] and [winapi]
23-
24-
`gpu-allocator` recently migrated from [winapi] to [windows-rs] but still provides convenient helpers to convert to and from [winapi] types, enabled when compiling with the `public-winapi` crate feature.
25-
26-
[Windows-rs]: https://github.com/microsoft/windows-rs
27-
[winapi]: https://github.com/retep998/winapi-rs
28-
2922
## Setting up the Vulkan memory allocator
3023

3124
```rust

‎examples/d3d12-buffer.rs

-283
This file was deleted.

0 commit comments

Comments
 (0)