From 8320b4e1bc751553d529e736bdeb85ddc802050c Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 19:57:25 -0700 Subject: [PATCH] gpu: add RenderBundleEncoder.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 11 ----------- gpu/src/render_bundle_encoder.zig | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index a4602188..40a6478c 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,14 +1,3 @@ -pub const WGPURenderBundleEncoderDescriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - color_formats_count: u32, - color_formats: [*]const TextureFormat, - depth_stencil_format: TextureFormat, - sample_count: u32, - depth_read_only: bool, - stencil_read_only: bool, -}; - pub const WGPURenderPassDepthStencilAttachment = extern struct { view: TextureView, depth_load_op: LoadOp, diff --git a/gpu/src/render_bundle_encoder.zig b/gpu/src/render_bundle_encoder.zig index c61afb3a..6248cc8d 100644 --- a/gpu/src/render_bundle_encoder.zig +++ b/gpu/src/render_bundle_encoder.zig @@ -1,6 +1,20 @@ +const ChainedStruct = @import("types.zig").ChainedStruct; +const Texture = @import("texture.zig").Texture; + pub const RenderBundleEncoder = enum(usize) { _, // TODO: verify there is a use case for nullable value of this type. pub const none: RenderBundleEncoder = @intToEnum(RenderBundleEncoder, 0); + + pub const Descriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + color_formats_count: u32, + color_formats: [*]const Texture.Format, + depth_stencil_format: Texture.Format, + sample_count: u32, + depth_read_only: bool, + stencil_read_only: bool, + }; };