From d70f5695b66720a5c6c9847d4de1cac6fd1d18a1 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 15:00:42 -0700 Subject: [PATCH] gpu: add BlendState Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 5 ----- gpu/src/main.zig | 3 ++- gpu/src/structs.zig | 17 +++++++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/gpu/src/TODO b/gpu/src/TODO index 8cdfdd40..19993cbc 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -392,11 +392,6 @@ typedef struct WGPURenderPassDepthStencilAttachment { -typedef struct WGPUBlendState { - WGPUBlendComponent color; - WGPUBlendComponent alpha; -} WGPUBlendState; - typedef struct WGPURenderPassColorAttachment { WGPUTextureView view; WGPUTextureView resolveTarget; diff --git a/gpu/src/main.zig b/gpu/src/main.zig index 5d023a58..d1fa090d 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -76,12 +76,13 @@ pub const ComputePipeline = @import("ComputePipeline.zig"); // Data structures pub const Limits = @import("structs.zig").Limits; -pub const BlendComponent = @import("structs.zig").BlendComponent; pub const Color = @import("structs.zig").Color; pub const Extent3D = @import("structs.zig").Extent3D; pub const Origin3D = @import("structs.zig").Origin3D; pub const StencilFaceState = @import("structs.zig").StencilFaceState; pub const VertexAttribute = @import("structs.zig").VertexAttribute; +pub const BlendComponent = @import("structs.zig").BlendComponent; +pub const BlendState = @import("structs.zig").BlendState; // Enumerations pub const Feature = @import("enums.zig").Feature; diff --git a/gpu/src/structs.zig b/gpu/src/structs.zig index aeb9c80f..606a61d5 100644 --- a/gpu/src/structs.zig +++ b/gpu/src/structs.zig @@ -33,12 +33,6 @@ pub const Limits = extern struct { max_compute_workgroups_per_dimension: u32, }; -pub const BlendComponent = extern struct { - operation: BlendOperation, - src_factor: BlendFactor, - dst_factor: BlendFactor, -}; - pub const Color = extern struct { r: f64, g: f64, @@ -70,3 +64,14 @@ pub const VertexAttribute = extern struct { offset: u64, shader_location: u32, }; + +pub const BlendComponent = extern struct { + operation: BlendOperation, + src_factor: BlendFactor, + dst_factor: BlendFactor, +}; + +pub const BlendState = extern struct { + color: BlendComponent, + alpha: BlendComponent, +};