gpu: add RenderPipeline.Descriptor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
122713a44d
commit
616395c583
3 changed files with 20 additions and 12 deletions
|
|
@ -1,14 +1,3 @@
|
||||||
pub const WGPURenderPipelineDescriptor = 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
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata);
|
typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata);
|
||||||
typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, WGPUCompilationInfo const * compilationInfo, void * userdata);
|
typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, WGPUCompilationInfo const * compilationInfo, void * userdata);
|
||||||
typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata);
|
typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata);
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
pub const RenderPipeline = enum(usize) {
|
||||||
_,
|
_,
|
||||||
|
|
||||||
// TODO: verify there is a use case for nullable value of this type.
|
// TODO: verify there is a use case for nullable value of this type.
|
||||||
pub const none: RenderPipeline = @intToEnum(RenderPipeline, 0);
|
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
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,7 @@ pub const CopyTextureForBrowserOptions = extern struct {
|
||||||
dst_alpha_mode: AlphaMode,
|
dst_alpha_mode: AlphaMode,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const MultisampleState = struct {
|
pub const MultisampleState = extern struct {
|
||||||
next_in_chain: *const ChainedStruct,
|
next_in_chain: *const ChainedStruct,
|
||||||
count: u32,
|
count: u32,
|
||||||
mask: u32,
|
mask: u32,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue