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

API contract for wgpuInstanceProcessEvents() is unclear #117

Closed
litherum opened this issue Nov 16, 2021 · 5 comments
Closed

API contract for wgpuInstanceProcessEvents() is unclear #117

litherum opened this issue Nov 16, 2021 · 5 comments

Comments

@litherum
Copy link

Its not clear whether it supposed to block or not, and how it integrates with an already-existing runloop.

@kvark
Copy link
Collaborator

kvark commented Nov 30, 2021

In wgpu-native this call (also referred to as Tick() sometimes) would do the following:

  • check in-flight GPU work and free resources no longer used by GPU
  • issue mapping callbacks
  • not block on any GPU work

@Kangz
Copy link
Collaborator

Kangz commented Nov 30, 2021

Same for Dawn (although it's currently wgpu::Device::Tick), it:

  • Checks for completion of GPU commands.
  • Fires any callbacks that need firing.
  • Frees resources.
  • (does an implicit submit of pending commands, but that's unobservable).
  • Returns immediately without blocking.

@litherum
Copy link
Author

litherum commented Dec 7, 2021

I suppose it has to be reentrant, then, huh.

@litherum litherum closed this as completed Dec 7, 2021
@Kangz
Copy link
Collaborator

Kangz commented Dec 7, 2021

Reentrant? But yeah during the processing you have to support more callbacks being added to the queue (and first move the queue, then process it, to avoid iterator invalidation)

@kainino0x
Copy link
Collaborator

I don't think wgpuInstanceProcessEvents() needs to be callable from within a callback running inside wgpuInstanceProcessEvents(). But yes to the stuff Corentin said.

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

No branches or pull requests

4 participants