Skip to content

webgpu: fixes for deadlock, over-flushing#9776

Open
poweifeng wants to merge 2 commits intomainfrom
pf/webgpu-unblock
Open

webgpu: fixes for deadlock, over-flushing#9776
poweifeng wants to merge 2 commits intomainfrom
pf/webgpu-unblock

Conversation

@poweifeng
Copy link
Contributor

  • In finish(), instead of block to wait for read pixels to finish, we poll the state of the counter to ensure that all the readbacks are complete. This allows us to complete the readpixel callbacks by advancing webgpu's internal callback counter.
  • Remove all the redundant flushes that are no longer needed now that buffer upload is put on the command queue.
  • Add a convenience method for getting swapchain dimensions. Will be useful.
  • Add webgpu as a valid backend for running backend tests on linux (now that it no longer deadlocks).

 - In finish(), instead of block to wait for read pixels to finish,
   we poll the state of the counter to ensure that all the readbacks
   are complete.  This allows us to complete the readpixel callbacks
   by advancing webgpu's internal callback counter.
 - Remove all the redundant flushes that are no longer needed now
   that buffer upload is put on the command queue.
 - Add a convenience method for getting swapchain dimensions. Will
   be useful.
 - Add webgpu as a valid backend for running backend tests on linux
   (now that it no longer deadlocks).
@poweifeng poweifeng added the internal Issue/PR does not affect clients label Mar 5, 2026
@poweifeng poweifeng requested a review from yrcloud March 5, 2026 18:39
Copy link
Collaborator

@yrcloud yrcloud left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Issue/PR does not affect clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants