From 7509404a91df7b749fad4023917c0bee2278f52a Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 16:30:03 -0700 Subject: [PATCH] gpu: add RenderBundleEncoder.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/src/RenderBundleEncoder.zig | 12 ++++++++++++ gpu/src/TODO | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/gpu/src/RenderBundleEncoder.zig b/gpu/src/RenderBundleEncoder.zig index a4a5ecdd..44a0face 100644 --- a/gpu/src/RenderBundleEncoder.zig +++ b/gpu/src/RenderBundleEncoder.zig @@ -1,3 +1,5 @@ +const Texture = @import("Texture.zig"); + const RenderBundleEncoder = @This(); /// The type erased pointer to the RenderBundleEncoder implementation @@ -36,8 +38,18 @@ pub inline fn setLabel(enc: RenderBundleEncoder, label: [:0]const u8) void { enc.vtable.setLabel(enc.ptr, label); } +pub const Descriptor = struct { + label: ?[*:0]const u8 = null, + color_formats: []Texture.Format, + depth_stencil_format: Texture.Format, + sample_count: u32, + depth_read_only: bool, + stencil_read_only: bool, +}; + test "syntax" { _ = VTable; _ = reference; _ = release; + _ = Descriptor; } diff --git a/gpu/src/TODO b/gpu/src/TODO index f4dc4bee..2455d226 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -57,17 +57,6 @@ typedef struct WGPUDawnTogglesDeviceDescriptor { -typedef struct WGPURenderBundleEncoderDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - uint32_t colorFormatsCount; - WGPUTextureFormat const * colorFormats; - WGPUTextureFormat depthStencilFormat; - uint32_t sampleCount; - bool depthReadOnly; - bool stencilReadOnly; -} WGPURenderBundleEncoderDescriptor; - typedef struct WGPUSamplerDescriptor { WGPUChainedStruct const * nextInChain; char const * label;