From 286cbb6160f92dcc24da67b4488894c3fbaa69ff Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 16 Jul 2022 20:58:33 -0700 Subject: [PATCH] gpu: add ComputePipeline.Descriptor Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 7 ------- gpu/src/compute_pipeline.zig | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index c4e566e0..c22b8737 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,10 +1,3 @@ -pub const WGPUComputePipelineDescriptor = extern struct { - next_in_chain: *const ChainedStruct, - label: ?[*:0]const u8 = null, - layout: PipelineLayout = PipelineLayout.none, // nullable - compute: ProgrammableStageDescriptor, -}; - pub const WGPUDeviceDescriptor = extern struct { next_in_chain: *const ChainedStruct, label: ?[*:0]const u8 = null, diff --git a/gpu/src/compute_pipeline.zig b/gpu/src/compute_pipeline.zig index 02e1afa2..9ed854bd 100644 --- a/gpu/src/compute_pipeline.zig +++ b/gpu/src/compute_pipeline.zig @@ -1,6 +1,17 @@ +const ChainedStruct = @import("types.zig").ChainedStruct; +const ProgrammableStageDescriptor = @import("types.zig").ProgrammableStageDescriptor; +const PipelineLayout = @import("pipeline_layout.zig").PipelineLayout; + pub const ComputePipeline = enum(usize) { _, // TODO: verify there is a use case for nullable value of this type. pub const none: ComputePipeline = @intToEnum(ComputePipeline, 0); + + pub const Descriptor = extern struct { + next_in_chain: *const ChainedStruct, + label: ?[*:0]const u8 = null, + layout: PipelineLayout = PipelineLayout.none, // nullable + compute: ProgrammableStageDescriptor, + }; };