Last updated: 2026-06-12
Vulkan Runtime
Instance
Initialize Vulkan, select a compute-capable device, and expose memory utilities.
This is the entry point for GPU setup: instance creation, device selection, queue discovery, and VRAM inspection.
3 exports shown
constant
PushDescriptorFn
pub const PushDescriptorFn = *const fn ( vk.c.VkCommandBuffer, vk.c.VkPipelineBindPoint, vk.c.VkPipelineLayout, u32, u32, [*]const vk.c.VkWriteDescriptorSet, ) callconv(.c) void Function pointer type for `vkCmdPushDescriptorSetKHR` when the extension is enabled.
struct
DeviceCapabilities
pub const DeviceCapabilities = struct Queried Vulkan device capabilities that affect pipeline creation choices.
Methods
1method
DeviceCapabilities.supportsRequiredSubgroupSize
pub fn supportsRequiredSubgroupSize(self: DeviceCapabilities, size: u32) bool Return whether a compute shader can request the given subgroup size at pipeline creation.
struct
Instance
pub const Instance = struct Active Vulkan instance, selected physical device, logical device, and memory metadata.
Methods
4method
Instance.init
pub fn init(allocator: std.mem.Allocator, preferred_device: u32) !Instance Create a Vulkan instance and select a compute-capable device.
method
Instance.deinit
pub fn deinit(self: *Instance) void Wait for outstanding work, destroy the logical device, and destroy the Vulkan instance.
method
Instance.findMemoryType
pub fn findMemoryType(self: *const Instance, type_filter: u32, properties: vk.c.VkMemoryPropertyFlags) ?u32 Find a Vulkan memory type that satisfies both compatibility and property requirements.
method
Instance.vramBytes
pub fn vramBytes(self: *const Instance) u64 Sum the size of all device-local memory heaps exposed by the selected GPU.