Return the number of ongoing tasks from device_poll
#1203
Labels
area: ecosystem
Help the connected projects grow and prosper
help required
We need community help to make this happen.
type: enhancement
New feature or request
Is your feature request related to a problem? Please describe.
It is currently difficult to efficiently poll the device to resolve pending task by dispatching callbacks (in a non-blocking fashion). In the ideal scenario you would only poll the device when a pending task is ready. This is not really possible because you don't know when a task is ready until you actually poll it (duh), or if the wgpu backend could somehow notify you if the task is completed (don't know how this would be implemented).
The next best thing is to poll only while you know there are ongoing tasks. The most effective way of doing this would be to start polling in some sort of loop until all pending tasks are done. Currently there is no easy way to tell that there are still pending tasks.
Describe the solution you'd like
device_poll
should return the number of still pending tasks, or return a boolean specifying if there are still pending tasks.Additional context
Related discussion on matrix: https://matrix.to/#/!XFRnMvAfptAHthwBCx:matrix.org/$6OXPFIL3wD2t0dWy-RsngKOkTiJ7f3iBtZtKCWV87tw?via=matrix.org
The text was updated successfully, but these errors were encountered: