Skip to content

[wgpu-sync]: Centralize usage of once_cell - #10091

Open
bushrat011899 wants to merge 5 commits into
gfx-rs:trunkfrom
bushrat011899:wgpu_sync_once_cell
Open

[wgpu-sync]: Centralize usage of once_cell#10091
bushrat011899 wants to merge 5 commits into
gfx-rs:trunkfrom
bushrat011899:wgpu_sync_once_cell

Conversation

@bushrat011899

Copy link
Copy Markdown
Contributor

Connections

None.

Description

While working on #9780, I noticed once_cell and std::sync are inconsistently used across wgpu-hal and wgpu-core. Similar to that PR, I'm proposing we centralize usage of Lazy, OnceCell, etc. to wgpu-sync, to make no_std configuration simpler and reduce maintenance burden.

Testing

cargo check, as there are no changes in the public API or behaviour (beyond exporting once_cell in the psuedo-public wgpu-sync API).

Squash or Rebase?

Rebase.

Checklist

  • I self-reviewed and fully understand this PR.
  • WebGPU implementations built with wgpu may be affected behaviorally.
  • Validation and feature gates are in place to confine behavioral changes.
  • Tests demonstrate the validation and altered logic works.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
    • Could split each commit into its own PR but it feels excessive, happy to if requested!
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

Comment thread wgpu-sync/Cargo.toml Outdated
bushrat011899 and others added 5 commits August 19, 2026 08:09
Centralizes configuration of `once_cell` and avoids duplicating fallback logic across crates.
Replaces both `std::sync` and `once_cell` usage.
The project is otherwise not `no_alloc` compatible, and is capable of making a breaking change in the future if desirable.

Co-Authored-By: Kevin Reid <kpreid@switchb.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants