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

Only poll device when reading data instead of blocking #2032

Closed
wants to merge 1 commit into from

Conversation

ArthurBrussee
Copy link
Contributor

Changes

According to wgpu docs, the device only needs to be polled for the map_async to complete at some point. Waiting for the channel does the actual waiting (async or blocking).

This is not very different, but, Maintain::Wait also prevents other threads from submitting commands, leading to stalls in multithreaded scenarios. Here's a before and after of a multithreaded app:

Screenshot 2024-07-17 at 12 04 06 Screenshot 2024-07-17 at 12 04 51

(Send batch is waiting on a read).

@ArthurBrussee ArthurBrussee marked this pull request as draft July 17, 2024 17:11
@ArthurBrussee
Copy link
Contributor Author

Hm, converting this to draft for a sec as it seems tests are timing out waiting for data :/ Maybe poll isn't enough after all, will investigate.

@ArthurBrussee ArthurBrussee deleted the read-poll branch August 13, 2024 13:37
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.

1 participant