LavaCake 2.0.0
LavaCake 2.0 is a complete rewrite of the library. The entire API surface is new — nothing from 1.x carries over directly.
Core architecture
- Header-only. Drop in via CMake
find_packageorFetchContent, no separate compilation step. - Built on vulkan.hpp. All handles and enums are the vulkan.hpp types; raw
Vk*handles are not exposed. - Vulkan 1.3 dynamic rendering is mandatory — there are no render passes anywhere in the API.
- VMA is the sole allocator for buffers and images. A thin flag wrapper is provided for allocation tuning.
Device creation
- Four factory functions cover the common cases:
createBasicDevice,createWindowedDevice,createAdvancedDevice,createHeadlessDevice. - A fluent
Device::Builderis available for full control: queue counts, validation layers, instance/device extensions, 46 individual Vulkan 1.0 feature toggles, and a genericaddFeature<T>()for any feature struct in the chain.
Window-manager agnostic
- Surface creation is driven by a
SurfaceConfigstruct containing an extension list and acreateSurfacecallback. The library has no direct dependency on any windowing library. - Drop-in helpers are provided for GLFW (
GLFWSupport.hpp) and SDL2 (SDL2Support.hpp). Both automatically populate the preferred extent for Wayland compatibility.
Swapchain resizing
Device::resizeSwapchain()destroys and recreates the swapchain in one call, passing the old swapchain to the driver for reuse.- Accepts an optional
vk::Extent2Dfor platforms (Wayland) wherecurrentExtentisUINT32_MAX. Falls back to the extent captured at device creation time if none is supplied.
Pipelines and shaders
- Runtime GLSL-to-SPIR-V compilation via shaderc. Pre-compiled SPIR-V byte code is also accepted.
GraphicsPipeline::BuilderandComputePipeline::Buildercover the full pipeline state with a fluent API.- Bindless rendering is fully supported: descriptor indexing is enabled by default in the factory functions.
Descriptors
DescriptorSetLayout::Builder,DescriptorPool, andDescriptorSetUpdaterprovide type-safe descriptor management without raw Vulkan calls.
ImGui
ImGuiRendererrenders ImGui draw lists directly into any image view. Vertex and fragment shaders are embedded as SPIR-V.
Examples — 13 total
- Basic: clear screen, colored triangle (with resize handling), uniform buffer, vertex buffer, indexed quad, three bindless variants, rotating cube.
- Advanced: shadow mapping, multiple lights with bindless shadow arrays.
- Compute: headless vector addition.
- ImGui: full demo overlay.
Build and install
- CMake 3.13+, C++20.
cmake --installproduces a relocatable package with headers, shaderc, and CMake config files. macOS, Linux, and Windows (untested) are supported.