From 7eb06f25f6b2081f767d3e7fb25b7555873491db Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 17:04:34 -0700 Subject: [PATCH] gpu: add RenderPassEncoder.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/src/RenderPassEncoder.zig | 14 ++++++++++++++ gpu/src/TODO | 11 ----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gpu/src/RenderPassEncoder.zig b/gpu/src/RenderPassEncoder.zig index b349f957..70589676 100644 --- a/gpu/src/RenderPassEncoder.zig +++ b/gpu/src/RenderPassEncoder.zig @@ -1,3 +1,8 @@ +const QuerySet = @import("QuerySet.zig"); +const RenderPassColorAttachment = @import("structs.zig").RenderPassColorAttachment; +const RenderPassDepthStencilAttachment = @import("structs.zig").RenderPassDepthStencilAttachment; +const RenderPassTimestampWrite = @import("structs.zig").RenderPassTimestampWrite; + const RenderPassEncoder = @This(); /// The type erased pointer to the RenderPassEncoder implementation @@ -45,8 +50,17 @@ pub inline fn setLabel(pass: RenderPassEncoder, label: [:0]const u8) void { pass.vtable.setLabel(pass.ptr, label); } +pub const Descriptor = struct { + label: ?[*:0]const u8 = null, + color_attachments: []const RenderPassColorAttachment, + depth_stencil_attachment: *const RenderPassDepthStencilAttachment, + occlusion_query_set: QuerySet, + timestamp_writes: []RenderPassTimestampWrite, +}; + test "syntax" { _ = VTable; _ = reference; _ = release; + _ = Descriptor; } diff --git a/gpu/src/TODO b/gpu/src/TODO index 6e6ee2bb..4f2c8863 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -57,17 +57,6 @@ typedef struct WGPUDawnTogglesDeviceDescriptor { -typedef struct WGPURenderPassDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - uint32_t colorAttachmentCount; - WGPURenderPassColorAttachment const * colorAttachments; - WGPURenderPassDepthStencilAttachment const * depthStencilAttachment; - WGPUQuerySet occlusionQuerySet; - uint32_t timestampWriteCount; - WGPURenderPassTimestampWrite const * timestampWrites; -} WGPURenderPassDescriptor; - typedef struct WGPURenderPipelineDescriptor { WGPUChainedStruct const * nextInChain; char const * label;