gpu: convert PipelineLayout from enum(usize) to *opaque

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-24 14:52:33 -07:00 committed by Stephen Gutekanst
parent 1d07d1784e
commit d50bc3527b
3 changed files with 8 additions and 13 deletions

View file

@ -7,6 +7,6 @@ pub const ComputePipeline = *opaque {};
pub const ComputePipelineDescriptor = extern struct {
next_in_chain: *const ChainedStruct,
label: ?[*:0]const u8 = null,
layout: PipelineLayout = PipelineLayout.none, // nullable
layout: ?PipelineLayout,
compute: ProgrammableStageDescriptor,
};

View file

@ -1,16 +1,11 @@
const ChainedStruct = @import("types.zig").ChainedStruct;
const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout;
pub const PipelineLayout = enum(usize) {
_,
pub const PipelineLayout = *opaque {};
// TODO: verify there is a use case for nullable value of this type.
pub const none: PipelineLayout = @intToEnum(PipelineLayout, 0);
pub const Descriptor = extern struct {
next_in_chain: *const ChainedStruct,
label: ?[*:0]const u8 = null,
bind_group_layout_count: u32,
bind_group_layouts: [*]const BindGroupLayout,
};
pub const PipelineLayoutDescriptor = extern struct {
next_in_chain: *const ChainedStruct,
label: ?[*:0]const u8 = null,
bind_group_layout_count: u32,
bind_group_layouts: [*]const BindGroupLayout,
};

View file

@ -15,7 +15,7 @@ pub const RenderPipeline = enum(usize) {
pub const Descriptor = extern struct {
next_in_chain: *const ChainedStruct,
label: ?[*:0]const u8 = null,
layout: PipelineLayout = PipelineLayout.none, // nullable
layout: ?PipelineLayout,
vertex: VertexState,
primitive: PrimitiveState,
depth_stencil: ?*const DepthStencilState = null, // nullable