From 4e6c6bbee8eb776206843416b60c24a3af0cb827 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 16:59:52 -0700 Subject: [PATCH] gpu: add ComputePipeline.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/src/ComputePipeline.zig | 10 ++++++++++ gpu/src/TODO | 7 ------- gpu/src/Texture.zig | 2 ++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gpu/src/ComputePipeline.zig b/gpu/src/ComputePipeline.zig index 2569bbdb..2d948179 100644 --- a/gpu/src/ComputePipeline.zig +++ b/gpu/src/ComputePipeline.zig @@ -1,3 +1,6 @@ +const PipelineLayout = @import("PipelineLayout.zig"); +const ProgrammableStageDescriptor = @import("structs.zig").ProgrammableStageDescriptor; + const ComputePipeline = @This(); /// The type erased pointer to the ComputePipeline implementation @@ -25,8 +28,15 @@ pub inline fn setLabel(pipeline: ComputePipeline, label: [:0]const u8) void { pipeline.vtable.setLabel(pipeline.ptr, label); } +pub const Descriptor = struct { + label: ?[*:0]const u8 = null, + layout: PipelineLayout, + compute: ProgrammableStageDescriptor, +}; + test "syntax" { _ = VTable; _ = reference; _ = release; + _ = Descriptor; } diff --git a/gpu/src/TODO b/gpu/src/TODO index d1fac777..6e6ee2bb 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -57,13 +57,6 @@ typedef struct WGPUDawnTogglesDeviceDescriptor { -typedef struct WGPUComputePipelineDescriptor { - WGPUChainedStruct const * nextInChain; - char const * label; - WGPUPipelineLayout layout; - WGPUProgrammableStageDescriptor compute; -} WGPUComputePipelineDescriptor; - typedef struct WGPURenderPassDescriptor { WGPUChainedStruct const * nextInChain; char const * label; diff --git a/gpu/src/Texture.zig b/gpu/src/Texture.zig index 6f79c268..3663549b 100644 --- a/gpu/src/Texture.zig +++ b/gpu/src/Texture.zig @@ -1,3 +1,5 @@ +const Extent3D = @import("data.zig").Extent3D; + const TextureView = @import("TextureView.zig"); const Texture = @This();