Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wgpu-hal] Change the DropGuard API in Vulkan and GLES to a callback-based one. #6164

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

jerzywilczek
Copy link
Contributor

This patch also unifies the behavior of the the DropGuard-ish constructs in the Vulkan and GLES implementations.

Connections
A change discussed in #6142. Closes #6142.

Description
Previously, when creating some wgpu structs from raw Vulkan or GLES counterparts, it was sometimes possible to provide a DropGuard, which would signal when the wgpu struct was dropped and the underlying structure could be cleaned up. Unfortunately, the behavior was very inconsistent across different *_from_raw functions. This patch unifies this behavior switching to a callback-based approach.

Testing
Things still compile and there is no difference in test passes.

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
      This just fails with many errors
  • Run cargo xtask test to run tests.
    41 tests fail on my PC, but they also fail without my changes.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@jerzywilczek jerzywilczek requested a review from a team as a code owner August 26, 2024 14:43
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, small comments

wgpu-hal/src/gles/device.rs Outdated Show resolved Hide resolved
wgpu-hal/src/vulkan/adapter.rs Outdated Show resolved Hide resolved
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@cwfitzgerald cwfitzgerald enabled auto-merge (squash) August 27, 2024 15:26
This patch also unifies the behavior of the the `DropGuard`-ish
constructs in the Vulkan-based implementation.
@cwfitzgerald cwfitzgerald merged commit a9047c2 into gfx-rs:trunk Aug 27, 2024
25 checks passed
@ErichDonGubler
Copy link
Member

Pushed c2563dc to the impending squash-merge so that CI passes and actually does the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants