diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 1c093311..166c9a0a 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,10 +1,3 @@ -typedef struct WGPUBufferBindingLayout { - WGPUChainedStruct const * nextInChain; - WGPUBufferBindingType type; - bool hasDynamicOffset; - uint64_t minBindingSize; -} WGPUBufferBindingLayout; - typedef struct WGPUBufferDescriptor { WGPUChainedStruct const * nextInChain; char const * label; // nullable diff --git a/gpu/src/Buffer.zig b/gpu/src/Buffer.zig index bcca5c95..190196a0 100644 --- a/gpu/src/Buffer.zig +++ b/gpu/src/Buffer.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const ChainedStruct = @import("types.zig").ChainedStruct; pub const Buffer = enum(usize) { _, @@ -48,4 +49,11 @@ pub const Buffer = enum(usize) { return @truncate(u10, @bitCast(u32, a)) == @truncate(u10, @bitCast(u32, b)); } }; + + pub const BindingLayout = extern struct { + next_in_chain: *const ChainedStruct, + type: BindingType, + has_dynamic_offset: bool = false, + min_binding_size: u64 = 0, + }; };