Vulkan
Vulkan provides typed records, native calls and helpers for a single graphics/presentation queue and a triangle renderer. It is a focused subset, not a promise that every Vulkan feature or rendering architecture is wrapped.
Resource creation order
- Create a window system and window when presenting to a display.
- Create an instance with the required surface extensions.
- Create a surface and select a compatible physical device/queue family.
- Create a logical device, swapchain, shader modules and graphics pipeline.
- Create frame resources, render and present.
- Finish GPU work and release resources in reverse dependency order.
import vulkan
let check_helpers = fn () -> i64 {
if Vulkan:clamp_u32(900, 64, 800) != 800 { return 1 }
if !Vulkan:has_flag(5, 4) { return 2 }
return 0
}
assert check_helpers() == 0The helpers above need no graphics device. clamp_u32 requires ordered minimum/maximum bounds; has_flag expects a single power-of-two flag.
Importing the bindings defines a vocabulary; call your application function when you intend to start rendering.
Learning path
- Native types — Represent records, tags and flags correctly.
- Resources — Create the instance, surface and device in order.
- Swapchains — Handle framebuffer size and presentation changes.
- Pipelines — Create shaders and a rendering pipeline.
- Frames — Synchronize acquisition, drawing and presentation.