From 71ed3ad6f79f460b9c3ddf1a944a13e8170981e2 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 15 Jul 2022 00:44:53 -0700 Subject: [PATCH] gpu: add Buffer.BindingLayout Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 7 ------- gpu/src/Buffer.zig | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) 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, + }; };