From 9e88c8f9a88593195c286ec01491961babaed55a Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 24 Jul 2022 23:28:51 -0700 Subject: [PATCH] gpu: add DeviceLostCallback Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 1 - gpu/src/device.zig | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index a55dba53..62338d6a 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,4 +1,3 @@ -typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const * message, void * userdata); typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata); typedef void (*WGPULoggingCallback)(WGPULoggingType type, char const * message, void * userdata); typedef void (*WGPUQueueWorkDoneCallback)(WGPUQueueWorkDoneStatus status, void * userdata); diff --git a/gpu/src/device.zig b/gpu/src/device.zig index 73bc114b..1809e685 100644 --- a/gpu/src/device.zig +++ b/gpu/src/device.zig @@ -6,6 +6,12 @@ const QueueDescriptor = @import("queue.zig").QueueDescriptor; pub const Device = *opaque {}; +pub const DeviceLostCallback = fn ( + reason: DeviceLostReason, + message: [*:0]const u8, + userdata: *anyopaque, +) callconv(.C) void; + pub const DeviceLostReason = enum(u32) { undef = 0x00000000, destroyed = 0x00000001,