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, + }; };