Realm
A GPU board ringed by molten circuit traces

Vulkan in Rust.
Native and explicit.

1// SAFETY: the caller establishes native valid usage.
2unsafe {
3 let instance = vk::create_instance(&entry, &info, None)?;
4 let device = vk::create_device(&instance, physical, &device_info, None)?;
5
6 vk::cmd_bind_pipeline(&device, commands, vk::PipelineBindPoint::COMPUTE, pipeline)?;
7 vk::cmd_dispatch(&device, commands, 16, 16, 1)?;
8
9 vk::destroy_device(device, None);
10 vk::destroy_instance(instance, None);
11}

Two calling styles. One implementation.

Use free functions in the style of the C API or methods on the Instance and Device wrappers. Both dispatch directly through the same cached function pointers.

Fluent new().set_*() construction keeps backing storage live across every generated record, while native fields and the unsafe contract stay within reach.

The bindings the Oa Library is built on.

VK exposes native Vulkan handles and explicit lifetimes directly, with the complete unsafe contract. OA adds semantic values and manages execution through its runtime. Choose the layer that matches the application.

Cached dispatch

FnEntry, FnInstance, and FnDevice hold an immutable function table for each context. Calls use cached pointers without looking up symbols again.

Registry generated

The bindings cover 842 command spellings from the pinned Khronos registries, including all 234 core commands through Vulkan 1.4 and their aliases.

Two calling styles

Free functions take an explicit dispatch context; Instance and Device methods delegate to the same canonical implementation.

Borrowed construction

Type::new().set_*() keeps backing host storage live, derives checked array counts, and admits typed push_next chains. Raw fields remain available.

Explicit ownership

Vulkan calls remain unsafe: the caller owns valid usage, synchronization, and destruction. Drop never destroys native objects or waits for work.

Integrated allocator

Enable the allocator feature to use vk::mem for pools, virtual placement, mapping, budgets, and relocation with a bounded number of passes.

Zero toolchain

No Vulkan SDK, C compiler, or generator to run during your build. The default loader feature opens the system Vulkan library at runtime.

Qualification

Experimental. Physical execution is recorded on Intel HD Graphics 4400 (Vulkan 1.2) and Iris Xe (Vulkan 1.4) through Mesa on x86-64 Linux.
A GPU board with glowing circuit traces

A Rust allocator based on VMA.

Based on AMD's Vulkan Memory Allocator, vk::mem is written entirely in Rust. TLSF and linear strategies, custom pools, virtual placement, persistent mapping, budgets, and relocation with a bounded number of passes are available when you enable the allocator feature.

Managed buffers and images move through vk::mem operations; the native vk::create_buffer binding stays one layer below for callers who bind their own memory.

v0.13.5 inlines allocator publication and removes repeated export checks and reservations.

vkrust

Package

vk::

Namespace

MIT

License

0.13.5

Version

Allocator timings against VMA.

We compare paired medians for allocation and release together, with each sample run in a fresh process. The table shows the time for vk::mem relative to VMA 3.4.0. For 20 workloads, the full 95% interval was below 1.0×.[*]

Workloadvk / VMA95% interval
Virtual TLSF · churn at minimum offset0.624×0.619 to 0.630
Virtual linear · LIFO free0.697×0.607 to 0.711
Virtual linear · churn0.760×0.739 to 0.806
Virtual TLSF · churn · 32 live0.810×0.755 to 0.875
Pooled buffers · TLSF · reverse · 1 live0.911×0.902 to 0.928
Pooled buffers · TLSF · LIFO free0.924×0.903 to 0.936
Separate buffers · LIFO free0.966×0.948 to 1.026
Pooled buffer · map, write 8 bytes, unmap1.011×1.002 to 1.036
Separate images · LIFO free1.037×1.018 to 1.060
Pooled buffers · TLSF · shuffled free1.042×1.013 to 1.063
Pooled images · TLSF · LIFO free1.045×1.018 to 1.058
Pooled buffers · TLSF · churn · 32 live1.057×1.042 to 1.087
Pooled buffers · linear · shuffled free1.091×0.980 to 1.172
Workloads below 1.0× VMA23 / 44
Lowest measured ratio0.624×
Highest measured ratio1.091×
  • [*]

    Surface Laptop 5 with a Core i7-1265U, Intel Iris Xe (Alder Lake GT2), Mesa 26.3.1, loader 1.4.363, device API 1.4.363. The Rust release build used optimization level 3, thin LTO, and one codegen unit. VMA 3.4.0 used C++17 with -O3. Each workload used 20 interleaved pairs in fresh processes on . The measured development commit was 05bb378. Treat the intervals as descriptive for this device and driver. Full methodology and all 44 workloads.