Skip to content

Commit

Permalink
Remove stale and UB winapi compatibility layer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MarijnS95 committed Dec 10, 2024
1 parent e6dbe11 commit e07cabd
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 538 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- os: ubuntu-latest
features: vulkan,visualizer
- os: windows-latest
features: vulkan,visualizer,d3d12,public-winapi
features: vulkan,visualizer,d3d12
- os: macos-latest
features: vulkan,visualizer,metal
runs-on: ${{ matrix.os }}
Expand All @@ -56,7 +56,7 @@ jobs:
- os: ubuntu-latest
features: vulkan,visualizer
- os: windows-latest
features: vulkan,visualizer,d3d12,public-winapi
features: vulkan,visualizer,d3d12
- os: macos-latest
features: vulkan,visualizer,metal
runs-on: ${{ matrix.os }}
Expand Down
13 changes: 0 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ objc2-metal = { version = "0.2.1", default-features = false, features = [
"std",
], optional = true }

[target.'cfg(windows)'.dependencies]
# Only needed for public-winapi interop helpers
winapi = { version = "0.3.9", features = ["d3d12", "winerror", "impl-default", "impl-debug"], optional = true }

[target.'cfg(windows)'.dependencies.windows]
version = ">=0.53,<=0.58"
features = [
Expand All @@ -63,9 +59,6 @@ optional = true
ash = { version = "0.38", default-features = false, features = ["debug", "loaded"] }
env_logger = "0.10"

[target.'cfg(windows)'.dev-dependencies]
winapi = { version = "0.3.9", features = ["d3d12", "d3d12sdklayers", "dxgi1_6", "winerror", "impl-default", "impl-debug", "winuser", "windowsx", "libloaderapi"] }

[target.'cfg(windows)'.dev-dependencies.windows]
# API-breaks since Windows 0.58 only affect our examples
version = "0.58"
Expand All @@ -86,10 +79,6 @@ required-features = ["vulkan", "ash/loaded"]

[[example]]
name = "d3d12-buffer"
required-features = ["d3d12", "public-winapi"]

[[example]]
name = "d3d12-buffer-winrs"
required-features = ["d3d12"]

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

default = ["d3d12", "vulkan", "metal"]
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ gpu-allocator = "0.27.0"

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

## [Windows-rs] and [winapi]

`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.

[Windows-rs]: https://github.com/microsoft/windows-rs
[winapi]: https://github.com/retep998/winapi-rs

## Setting up the Vulkan memory allocator

```rust
Expand Down
243 changes: 0 additions & 243 deletions examples/d3d12-buffer-winrs.rs

This file was deleted.

Loading

0 comments on commit e07cabd

Please sign in to comment.