gpu: add RenderPipeline.Descriptor

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 17:17:48 -07:00 committed by Stephen Gutekanst
parent 48a3103bb9
commit 77810482bd
3 changed files with 19 additions and 10 deletions

View file

@ -1,3 +1,10 @@
const PipelineLayout = @import("PipelineLayout.zig");
const VertexState = @import("structs.zig").VertexState;
const PrimitiveState = @import("structs.zig").PrimitiveState;
const DepthStencilState = @import("structs.zig").DepthStencilState;
const MultisampleState = @import("structs.zig").MultisampleState;
const FragmentState = @import("structs.zig").FragmentState;
const RenderPipeline = @This(); const RenderPipeline = @This();
/// The type erased pointer to the RenderPipeline implementation /// The type erased pointer to the RenderPipeline implementation
@ -25,8 +32,19 @@ pub inline fn setLabel(pipeline: RenderPipeline, label: [:0]const u8) void {
pipeline.vtable.setLabel(pipeline.ptr, label); pipeline.vtable.setLabel(pipeline.ptr, label);
} }
pub const Descriptor = struct {
label: ?[*:0]const u8 = null,
layout: PipelineLayout,
vertex: VertexState,
primitive: PrimitiveState,
depth_stencil: *const DepthStencilState,
multisample: MultisampleState,
fragment: *const FragmentState,
};
test "syntax" { test "syntax" {
_ = VTable; _ = VTable;
_ = reference; _ = reference;
_ = release; _ = release;
_ = Descriptor;
} }

View file

@ -57,16 +57,6 @@ typedef struct WGPUDawnTogglesDeviceDescriptor {
typedef struct WGPURenderPipelineDescriptor {
WGPUChainedStruct const * nextInChain;
char const * label;
WGPUPipelineLayout layout;
WGPUVertexState vertex;
WGPUPrimitiveState primitive;
WGPUDepthStencilState const * depthStencil;
WGPUMultisampleState multisample;
WGPUFragmentState const * fragment;
} WGPURenderPipelineDescriptor;

View file

@ -6,6 +6,7 @@ const TextureView = @import("TextureView.zig");
const ShaderModule = @import("ShaderModule.zig"); const ShaderModule = @import("ShaderModule.zig");
const QuerySet = @import("QuerySet.zig"); const QuerySet = @import("QuerySet.zig");
const StencilFaceState = @import("data.zig").StencilFaceState; const StencilFaceState = @import("data.zig").StencilFaceState;
const Color = @import("data.zig").Color;
const CompilationMessageType = @import("enums.zig").CompilationMessageType; const CompilationMessageType = @import("enums.zig").CompilationMessageType;
const PrimitiveTopology = @import("enums.zig").PrimitiveTopology; const PrimitiveTopology = @import("enums.zig").PrimitiveTopology;
const IndexFormat = @import("enums.zig").IndexFormat; const IndexFormat = @import("enums.zig").IndexFormat;