Last updated: 2026-09-07
Vulkan Runtime
Vulkan Pipeline
Load SPIR-V compute shaders into Vulkan pipelines.
Dispatch helpers use this module to build descriptor layouts, pipeline layouts, and compute pipelines from the compiled shader binaries.
5 exports shown
struct
Pipeline
pub const Pipeline = struct A compute pipeline wrapping a SPIR-V shader module.
Methods
1method
Pipeline.deinit
pub fn deinit(self: *Pipeline) void Destroy the shader module, descriptor layout, pipeline layout, and pipeline.
struct
SpecConst
pub const SpecConst = struct Specialization constant entry for compute pipelines.
struct
PipelineOptions
pub const PipelineOptions = struct Optional compute-pipeline knobs for subgroup-sensitive shaders.
function
createFromSpirv
pub fn createFromSpirv( instance: *const Instance, spirv_path: []const u8, binding_count: u32, push_constant_size: u32, spec_constants: []const SpecConst, allocator: std.mem.Allocator, ) !Pipeline Create a compute pipeline from a SPIR-V file.
function
createFromSpirvWithOptions
pub fn createFromSpirvWithOptions( instance: *const Instance, spirv_path: []const u8, binding_count: u32, push_constant_size: u32, spec_constants: []const SpecConst, options: PipelineOptions, allocator: std.mem.Allocator, ) !Pipeline Create a compute pipeline from a SPIR-V file with optional subgroup and push-descriptor controls.
Reads the SPIR-V binary from disk, creates a shader module, builds a descriptor set layout (optionally flagged for push-descriptor recording), a pipeline layout with push constants, and a compute pipeline with specialization constants applied. Subgroup-size and full-subgroup requirements are silently dropped when the device does not support them.