diff --git a/gpu/src/NativeInstance.zig b/gpu/src/NativeInstance.zig index 28b74be8..d8f1ed7d 100644 --- a/gpu/src/NativeInstance.zig +++ b/gpu/src/NativeInstance.zig @@ -902,7 +902,7 @@ const queue_vtable = Queue.VTable{ wgpu_queue, signal_value, cCallback, - &queue.on_submitted_work_done, + queue.on_submitted_work_done, ); } diff --git a/gpu/src/Queue.zig b/gpu/src/Queue.zig index 206be857..2e5b5a9c 100644 --- a/gpu/src/Queue.zig +++ b/gpu/src/Queue.zig @@ -8,7 +8,10 @@ const Texture = @import("Texture.zig"); const Queue = @This(); -on_submitted_work_done: ?WorkDoneCallback = null, +/// Callback to executed when all work has been done +/// This field must be set before calling `submit()` on the commands the callback waits for. +/// Note that the address stored must be valid when the callback is executed. +on_submitted_work_done: ?*WorkDoneCallback = null, /// The type erased pointer to the Queue implementation /// Equal to c.WGPUQueue for NativeInstance.