A Kotlin wrapper for Vulkan that enhances developer experience with type safety, collection support, and concise syntax.
VK² is a Kotlin wrapper for the Vulkan graphics and compute API that provides a more expressive and type-safe interface for JVM developers. It simplifies Vulkan programming by adding features like collection support, exception handling, and automatic struct initialization while minimizing runtime overhead.
Kotlin developers working on graphics-intensive applications, game engines, or compute pipelines who need direct Vulkan access with improved productivity.
Developers choose VK² for its blend of low-level control and Kotlin's conciseness, offering a safer and more intuitive alternative to raw Vulkan bindings without compromising performance.
VK², Kotlin Wrapper for Vulkan: code expressiveness and safety meet graphic power
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enums and bitfields are wrapped as scoped enums, preventing invalid values at compile time, as shown in the mapping of VK_COLOR_SPACE_SRGB_NONLINEAR_KHR to VkColorSpace.SRGB_NONLINEAR_KHR.
Extension functions expose Vulkan calls as member functions on handles, enabling intuitive syntax like device.bindBufferMemory(...), which reduces verbosity and improves readability.
CreateInfo structs have constructors that auto-fill sType and use Kotlin DSL-style builders, cutting down boilerplate and minimizing errors in Vulkan setup code.
Leverages LWJGL's MemoryStack for thread-local allocations, simplifying resource handling and reducing manual memory management overhead, as demonstrated in the examples.
Tied exclusively to the JVM ecosystem and Kotlin language, making it unsuitable for native development or projects using other languages without complex interop.
Despite aiming for minimal CPU cost, the abstraction layer and JVM runtime can introduce slight overhead compared to direct C Vulkan calls, which might be problematic for ultra-high-performance graphics.
The README includes a TODO section, indicating gaps in guides, examples, or coverage of advanced features, which could hinder onboarding or troubleshooting.