From 5094ad2e72b37b0731cc0b052c431750a787c9fd Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 15 Jul 2022 23:20:08 -0700 Subject: [PATCH] gpu: add dawn.CacheDeviceDescriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 5 ----- gpu/src/dawn.zig | 7 +++++++ gpu/src/main.zig | 4 ++++ 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 gpu/src/dawn.zig diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 0bbd4fec..8573216f 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,8 +1,3 @@ -typedef struct WGPUDawnCacheDeviceDescriptor { - WGPUChainedStruct chain; - char const * isolationKey; -} WGPUDawnCacheDeviceDescriptor; - typedef struct WGPUDawnEncoderInternalUsageDescriptor { WGPUChainedStruct chain; use_internal_usages: bool, diff --git a/gpu/src/dawn.zig b/gpu/src/dawn.zig new file mode 100644 index 00000000..12a11640 --- /dev/null +++ b/gpu/src/dawn.zig @@ -0,0 +1,7 @@ +const ChainedStruct = @import("types.zig").ChainedStruct; + +pub const CacheDeviceDescriptor = struct { + // TODO: file an issue on Dawn: why not named nextInChain? + chain: ChainedStruct, + isolation_key: [*:0]const u8, +}; diff --git a/gpu/src/main.zig b/gpu/src/main.zig index a33e6f79..7cc83c3a 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -34,9 +34,12 @@ pub const SwapChain = @import("swap_chain.zig").SwapChain; pub const Texture = @import("texture.zig").Texture; pub const TextureView = @import("texture_view.zig").TextureView; +pub const dawn = @import("dawn.zig"); + // TODO: export all types.zig pub const AlphaMode = @import("types.zig").AlphaMode; pub const ComputePassTimestampLocation = @import("types.zig").ComputePassTimestampLocation; +pub const ChainedStruct = @import("types.zig").ChainedStruct; pub const ComputePassTimestampWrite = struct { query_set: QuerySet, @@ -64,6 +67,7 @@ test { refAllDecls(@import("command_encoder.zig")); refAllDecls(@import("compute_pass_encoder.zig")); refAllDecls(@import("compute_pipeline.zig")); + refAllDecls(@import("dawn.zig")); refAllDecls(@import("device.zig")); refAllDecls(@import("external_texture.zig")); refAllDecls(@import("instance.zig"));