Skip to content

[core] Wrap Instance in Arc and store it in Adapter - #9956

Open
sagudev wants to merge 3 commits into
gfx-rs:trunkfrom
sagudev:device-has-instance
Open

[core] Wrap Instance in Arc and store it in Adapter#9956
sagudev wants to merge 3 commits into
gfx-rs:trunkfrom
sagudev:device-has-instance

Conversation

@sagudev

@sagudev sagudev commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Connections
Needed for #9950

Description
Currently global enforces drop order so that instance is dropped last:

// the instance must be dropped last

But when global is avoided we need to enforce this manually. We already need some of it's data in Adapter so this allows us to remove it. The new ownership chain that fixes the issue in #9950 is Queue -> Device -> Adapter -> Instance.

Testing
Should be covered by existing tests and new ownership chain fixes the problem in #9950.

Squash or Rebase?

Squash

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.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

@Wumpf Wumpf self-assigned this Jul 29, 2026
@sagudev sagudev changed the title [core] Wrap Instance in Arc so we can store it in Adapter [core] Wrap Instance in Arc and store it in Adapter Jul 30, 2026
sagudev added 2 commits July 30, 2026 12:31
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev
sagudev force-pushed the device-has-instance branch from 3b7b7bb to b3e52d6 Compare July 30, 2026 10:31
@sagudev

This comment was marked as resolved.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
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