From 19425d4f866da8cadfe5dfd2f013a88bd1d3bd64 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 10 Jul 2022 22:05:02 -0700 Subject: [PATCH] gpu: add Buffer.MapAsyncStatus Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 10 ---------- gpu/src/Buffer.zig | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index e1f9f585..e3d4683f 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,15 +1,5 @@ typedef uint32_t WGPUFlags; -typedef enum WGPUBufferMapAsyncStatus { - WGPUBufferMapAsyncStatus_Success = 0x00000000, - WGPUBufferMapAsyncStatus_Error = 0x00000001, - WGPUBufferMapAsyncStatus_Unknown = 0x00000002, - WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003, - WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004, - WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005, - WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF -} WGPUBufferMapAsyncStatus; - typedef enum WGPUCompareFunction { WGPUCompareFunction_Undefined = 0x00000000, WGPUCompareFunction_Never = 0x00000001, diff --git a/gpu/src/Buffer.zig b/gpu/src/Buffer.zig index fa5199b6..8a182c74 100644 --- a/gpu/src/Buffer.zig +++ b/gpu/src/Buffer.zig @@ -6,3 +6,12 @@ pub const BindingType = enum(u32) { storage = 0x00000002, read_only_storage = 0x00000003, }; + +pub const MapAsyncStatus = enum(u32) { + success = 0x00000000, + err = 0x00000001, + unknown = 0x00000002, + device_lost = 0x00000003, + destroyed_before_callback = 0x00000004, + unmapped_before_callback = 0x00000005, +};