Skip to content

Commit e07cabd

Browse files
committed
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 e6dbe11 commit e07cabd

File tree

8 files changed

+113
-538
lines changed

8 files changed

+113
-538
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- os: ubuntu-latest
3030
features: vulkan,visualizer
3131
- os: windows-latest
32-
features: vulkan,visualizer,d3d12,public-winapi
32+
features: vulkan,visualizer,d3d12
3333
- os: macos-latest
3434
features: vulkan,visualizer,metal
3535
runs-on: ${{ matrix.os }}
@@ -56,7 +56,7 @@ jobs:
5656
- os: ubuntu-latest
5757
features: vulkan,visualizer
5858
- os: windows-latest
59-
features: vulkan,visualizer,d3d12,public-winapi
59+
features: vulkan,visualizer,d3d12
6060
- os: macos-latest
6161
features: vulkan,visualizer,metal
6262
runs-on: ${{ matrix.os }}

Cargo.toml

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

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

66-
[target.'cfg(windows)'.dev-dependencies]
67-
winapi = { version = "0.3.9", features = ["d3d12", "d3d12sdklayers", "dxgi1_6", "winerror", "impl-default", "impl-debug", "winuser", "windowsx", "libloaderapi"] }
68-
6962
[target.'cfg(windows)'.dev-dependencies.windows]
7063
# API-breaks since Windows 0.58 only affect our examples
7164
version = "0.58"
@@ -86,10 +79,6 @@ required-features = ["vulkan", "ash/loaded"]
8679

8780
[[example]]
8881
name = "d3d12-buffer"
89-
required-features = ["d3d12", "public-winapi"]
90-
91-
[[example]]
92-
name = "d3d12-buffer-winrs"
9382
required-features = ["d3d12"]
9483

9584
[[example]]
@@ -101,7 +90,5 @@ visualizer = ["dep:egui", "dep:egui_extras"]
10190
vulkan = ["dep:ash"]
10291
d3d12 = ["dep:windows"]
10392
metal = ["dep:objc2", "dep:objc2-metal", "dep:objc2-foundation"]
104-
# Expose helper functionality for winapi types to interface with gpu-allocator, which is primarily windows-rs driven
105-
public-winapi = ["dep:winapi"]
10693

10794
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-winrs.rs

-243
This file was deleted.

0 commit comments

Comments
 (0)