diff --git a/gpu/src/RenderPipeline.zig b/gpu/src/RenderPipeline.zig index 1df63659..4d08f4ae 100644 --- a/gpu/src/RenderPipeline.zig +++ b/gpu/src/RenderPipeline.zig @@ -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(); /// 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); } +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" { _ = VTable; _ = reference; _ = release; + _ = Descriptor; } diff --git a/gpu/src/TODO b/gpu/src/TODO index e99619ad..0c2c21fc 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -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; diff --git a/gpu/src/structs.zig b/gpu/src/structs.zig index a89fc441..353ebe33 100644 --- a/gpu/src/structs.zig +++ b/gpu/src/structs.zig @@ -6,6 +6,7 @@ const TextureView = @import("TextureView.zig"); const ShaderModule = @import("ShaderModule.zig"); const QuerySet = @import("QuerySet.zig"); const StencilFaceState = @import("data.zig").StencilFaceState; +const Color = @import("data.zig").Color; const CompilationMessageType = @import("enums.zig").CompilationMessageType; const PrimitiveTopology = @import("enums.zig").PrimitiveTopology; const IndexFormat = @import("enums.zig").IndexFormat;