From b505c5aecfc4e3d7403a4f5d024fe13164afd1e4 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 17:10:30 -0700 Subject: [PATCH] gpu: add RenderPassDepthStencilAttachment Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 14 -------------- gpu/src/main.zig | 1 + gpu/src/structs.zig | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/gpu/src/TODO b/gpu/src/TODO index 5b64b77c..10e261de 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -143,20 +143,6 @@ typedef struct WGPUPrimitiveDepthClampingState { bool clampDepth; } WGPUPrimitiveDepthClampingState; -typedef struct WGPURenderPassDepthStencilAttachment { - WGPUTextureView view; - WGPULoadOp depthLoadOp; - WGPUStoreOp depthStoreOp; - float clearDepth; - float depthClearValue; - bool depthReadOnly; - WGPULoadOp stencilLoadOp; - WGPUStoreOp stencilStoreOp; - uint32_t clearStencil; - uint32_t stencilClearValue; - bool stencilReadOnly; -} WGPURenderPassDepthStencilAttachment; - typedef struct WGPURenderPassColorAttachment { WGPUTextureView view; WGPUTextureView resolveTarget; diff --git a/gpu/src/main.zig b/gpu/src/main.zig index be93738a..4a77d03c 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -98,6 +98,7 @@ pub const ConstantEntry = @import("structs.zig").ConstantEntry; pub const ProgrammableStageDescriptor = @import("structs.zig").ProgrammableStageDescriptor; pub const ComputePassTimestampWrite = @import("structs.zig").ComputePassTimestampWrite; pub const RenderPassTimestampWrite = @import("structs.zig").RenderPassTimestampWrite; +pub const RenderPassDepthStencilAttachment = @import("structs.zig").RenderPassDepthStencilAttachment; // Enumerations pub const Feature = @import("enums.zig").Feature; diff --git a/gpu/src/structs.zig b/gpu/src/structs.zig index e2719420..34c99fc1 100644 --- a/gpu/src/structs.zig +++ b/gpu/src/structs.zig @@ -15,6 +15,8 @@ const StorageTextureAccess = @import("enums.zig").StorageTextureAccess; const CompareFunction = @import("enums.zig").CompareFunction; const ComputePassTimestampLocation = @import("enums.zig").ComputePassTimestampLocation; const RenderPassTimestampLocation = @import("enums.zig").RenderPassTimestampLocation; +const LoadOp = @import("enums.zig").LoadOp; +const StoreOp = @import("enums.zig").StoreOp; pub const CompilationMessage = struct { message: [:0]const u8, @@ -86,6 +88,20 @@ pub const RenderPassTimestampWrite = struct { location: RenderPassTimestampLocation, }; +pub const RenderPassDepthStencilAttachment = struct { + view: TextureView, + depth_load_op: LoadOp, + depth_store_op: StoreOp, + clear_depth: f32, + depth_clear_value: f32, + depth_read_only: bool, + stencil_load_op: LoadOp, + stencil_store_op: StoreOp, + clear_stencil: u32, + stencil_clear_value: u32, + stencil_read_only: bool, +}; + test "syntax" { _ = CompilationMessage; _ = CompilationInfo; @@ -97,4 +113,5 @@ test "syntax" { _ = ProgrammableStageDescriptor; _ = ComputePassTimestampWrite; _ = RenderPassTimestampWrite; + _ = RenderPassDepthStencilAttachment; }