diff --git a/wgpu/backends/wgpu_native/_helpers.py b/wgpu/backends/wgpu_native/_helpers.py index bbd2f742..2dfc8ba1 100644 --- a/wgpu/backends/wgpu_native/_helpers.py +++ b/wgpu/backends/wgpu_native/_helpers.py @@ -287,6 +287,10 @@ def __await__(self): # There is no documentation on what __await__() is supposed to return, but we # can certainly copy from a function that *does* know what to return async def wait_for_callback(): + # In all the async cases that I've tried, the result is either already set, or + # resolves after the first call to the poll function. To make sure that our + # sleep-logic actually works, we always do at least one sleep call. + await async_sleep(0) if self.result is not None: return if not self.poll_function: