From 3393813ebc58819aeb0d8ff615551523543c8765 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 16:15:09 -0700 Subject: [PATCH] gpu: add BindingGroupLayout.Entry Signed-off-by: Stephen Gutekanst --- gpu/src/BindGroupLayout.zig | 16 ++++++++++++++++ gpu/src/TODO | 10 ---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/gpu/src/BindGroupLayout.zig b/gpu/src/BindGroupLayout.zig index d5cc0e80..a1a3de65 100644 --- a/gpu/src/BindGroupLayout.zig +++ b/gpu/src/BindGroupLayout.zig @@ -1,3 +1,9 @@ +const Buffer = @import("Buffer.zig"); +const Sampler = @import("Sampler.zig"); +const Texture = @import("Texture.zig"); +const StorageTextureBindingLayout = @import("structs.zig").StorageTextureBindingLayout; +const ShaderStage = @import("enums.zig").ShaderStage; + const BindGroupLayout = @This(); /// The type erased pointer to the BindGroupLayout implementation @@ -23,9 +29,19 @@ pub inline fn setLabel(group: BindGroupLayout, label: [:0]const u8) void { group.vtable.setLabel(group.ptr, label); } +pub const Entry = struct { + binding: u32, + visibility: ShaderStage, + buffer: Buffer.BindingLayout, + sampler: Sampler.BindingLayout, + texture: Texture.BindingLayout, + storage_texture: StorageTextureBindingLayout, +}; + test "syntax" { _ = VTable; _ = reference; _ = release; _ = setLabel; + _ = Entry; } diff --git a/gpu/src/TODO b/gpu/src/TODO index 2c75d9f1..2c9ba54b 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -204,16 +204,6 @@ typedef struct WGPUCopyTextureForBrowserOptions { WGPUAlphaMode dstAlphaMode; } WGPUCopyTextureForBrowserOptions; -typedef struct WGPUBindGroupLayoutEntry { - WGPUChainedStruct const * nextInChain; - uint32_t binding; - WGPUShaderStageFlags visibility; - WGPUBufferBindingLayout buffer; - WGPUSamplerBindingLayout sampler; - WGPUTextureBindingLayout texture; - WGPUStorageTextureBindingLayout storageTexture; -} WGPUBindGroupLayoutEntry; - typedef struct WGPUCompilationInfo { WGPUChainedStruct const * nextInChain; uint32_t messageCount;