gpu: add RenderPipeline.Descriptor

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-16 21:08:22 -07:00 committed by Stephen Gutekanst
parent 122713a44d
commit 616395c583
3 changed files with 20 additions and 12 deletions

View file

@ -1,6 +1,25 @@
const ChainedStruct = @import("types.zig").ChainedStruct;
const DepthStencilState = @import("types.zig").DepthStencilState;
const MultisampleState = @import("types.zig").MultisampleState;
const VertexState = @import("types.zig").VertexState;
const PrimitiveState = @import("types.zig").PrimitiveState;
const FragmentState = @import("types.zig").FragmentState;
const PipelineLayout = @import("pipeline_layout.zig").PipelineLayout;
pub const RenderPipeline = enum(usize) {
_,
// TODO: verify there is a use case for nullable value of this type.
pub const none: RenderPipeline = @intToEnum(RenderPipeline, 0);
pub const Descriptor = extern struct {
next_in_chain: *const ChainedStruct,
label: ?[*:0]const u8 = null,
layout: PipelineLayout = PipelineLayout.none, // nullable
vertex: VertexState,
primitive: PrimitiveState,
depth_stencil: ?*const DepthStencilState = null, // nullable
multisample: MultisampleState,
fragment: ?*const FragmentState = null, // nullable
};
};

View file

@ -461,7 +461,7 @@ pub const CopyTextureForBrowserOptions = extern struct {
dst_alpha_mode: AlphaMode,
};
pub const MultisampleState = struct {
pub const MultisampleState = extern struct {
next_in_chain: *const ChainedStruct,
count: u32,
mask: u32,