Skip to content

Fix present synchronization#9036

Merged
cwfitzgerald merged 3 commits intogfx-rs:trunkfrom
inner-daemons:try-sync-fix-present
Mar 1, 2026
Merged

Fix present synchronization#9036
cwfitzgerald merged 3 commits intogfx-rs:trunkfrom
inner-daemons:try-sync-fix-present

Conversation

@inner-daemons
Copy link
Collaborator

@inner-daemons inner-daemons commented Feb 11, 2026

Connections
Closes #9003
Closes #9024

Description
This makes sure that the queue is effectively locked when presenting a texture, since this is still a queue operation and queue operations aren't threadsafe in vulkan.

Testing
Solves the issue

Squash or Rebase?
Squash pls, only commit name is dumb

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@SuchAFuriousDeath
Copy link
Contributor

I'll be testing this today.

@SuchAFuriousDeath
Copy link
Contributor

@inner-daemons I just tested and it does fix the issue.

@inner-daemons
Copy link
Collaborator Author

Ok so I'll add a changelog later. THen we can backport this

@inner-daemons inner-daemons changed the title Try to fix present synchronization Fix present synchronization Feb 14, 2026
@ArthurBrussee
Copy link

Any chance to have another look at this? I'm blocked on upgrading some deps as they're on wgpu 28 which currently crashes without this fix. This PR does indeed solve it. Thanks a lot for finding the fix btw!

@SuchAFuriousDeath
Copy link
Contributor

Yeah it would be nice for Ruffle too.

Some(resource::TextureInner::Surface { raw }) => {
let raw_surface = self.raw(device.backend()).unwrap();
let raw_queue = queue.raw();
let _fence_lock = device.fence.write();
Copy link
Member

Choose a reason for hiding this comment

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

Definitely need a comment about why this is needed as it's not obvious from the rest of the code. In the name of expediency, I will merge and backport this anyway, but @inner-daemons lets do this in a follow up.

@cwfitzgerald cwfitzgerald merged commit 78cd771 into gfx-rs:trunk Mar 1, 2026
58 checks passed
@cwfitzgerald cwfitzgerald added the PR: needs back-porting PR with a fix that needs to land on crates label Mar 1, 2026
cwfitzgerald pushed a commit to cwfitzgerald/wgpu that referenced this pull request Mar 1, 2026
cwfitzgerald pushed a commit to cwfitzgerald/wgpu that referenced this pull request Mar 1, 2026
@cwfitzgerald
Copy link
Member

Published in v28.0.1!

@cwfitzgerald cwfitzgerald removed the PR: needs back-porting PR with a fix that needs to land on crates label Mar 19, 2026
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.

Crash on nvidia cards since wgpu 28

4 participants