From 4fd4c5db7e47e467fdb19e2ae7cbf0246335d965 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 20:28:47 -0700 Subject: [PATCH] gpu: add BindGroup.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 8 -------- gpu/src/bind_group.zig | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index b8cbf66f..00871079 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,11 +1,3 @@ -pub const WGPUBindGroupDescriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - layout: BindGroupLayout, - entry_count: u32, - entries: [*]const BindGroupEntry, -}; - pub const WGPUBindGroupLayoutEntry = extern struct { next_in_chain: *const ChainedStruct, binding: u32, diff --git a/gpu/src/bind_group.zig b/gpu/src/bind_group.zig index 23910b2e..34832b3f 100644 --- a/gpu/src/bind_group.zig +++ b/gpu/src/bind_group.zig @@ -2,6 +2,7 @@ const Buffer = @import("buffer.zig").Buffer; const Sampler = @import("sampler.zig").Sampler; const TextureView = @import("texture_view.zig").TextureView; const ChainedStruct = @import("types.zig").ChainedStruct; +const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout; pub const BindGroup = enum(usize) { _, @@ -18,4 +19,12 @@ pub const BindGroup = enum(usize) { sampler: Sampler = Sampler.none, // nullable texture_view: TextureView = TextureView.none, // nullable }; + + pub const Descriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + layout: BindGroupLayout, + entry_count: u32, + entries: [*]const Entry, + }; };