diff --git a/CHANGELOG.md b/CHANGELOG.md index a458f3a2..4adb2e24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,13 @@ Possible sections in each release: Downstream code should capture that error and skip the frame, optionally invoking some sort of sleep to save energy. See https://github.com/pygfx/wgpu-py/pull/820 for context. +### Fixed: +* `GPUQueue.on_submitted_work_done_async()` no longer raises `TypeError` when + building its callback struct. The ffi callback was missing the + `WGPUStringView message` argument that the `WGPUQueueWorkDoneCallback` typedef + requires, so any call to it crashed. Also un-shadowed the test that covers + this path (it was named `make_pipeline_async` so pytest never collected it). + ## [v0.31.1] - 23-06-2026 diff --git a/tests/test_async.py b/tests/test_async.py index efc99307..fc18ed8c 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -769,7 +769,7 @@ async def test_buffer_map_async(): @mark.skipif(not can_use_wgpu_lib, reason="Needs wgpu lib") @mark.anyio -async def make_pipeline_async(): +async def test_pipeline_async(): device = wgpu.utils.get_default_device() shader_source = """ @@ -799,7 +799,7 @@ async def create_render_pipeline(): vertex={ "module": shader, }, - depth_stencil={"format": TextureFormat.rgba8unorm}, + depth_stencil={"format": TextureFormat.depth32float}, ) tg.start_soon(create_compute_pipeline) diff --git a/wgpu/backends/wgpu_native/_api.py b/wgpu/backends/wgpu_native/_api.py index c59d8dd0..f419f9d0 100644 --- a/wgpu/backends/wgpu_native/_api.py +++ b/wgpu/backends/wgpu_native/_api.py @@ -4080,8 +4080,8 @@ def read_texture( return data def on_submitted_work_done_async(self) -> GPUPromise[None]: - @ffi.callback("void(WGPUQueueWorkDoneStatus, void *, void *)") - def work_done_callback(status, _userdata1, _userdata2): + @ffi.callback("void(WGPUQueueWorkDoneStatus, WGPUStringView, void *, void *)") + def work_done_callback(status, _message, _userdata1, _userdata2): token.set_done() if status == lib.WGPUQueueWorkDoneStatus_Success: promise._wgpu_set_input(True)