GitHub - corporateshark/lightweightvk: LightweightVK is a deeply refactored bindless-only fork of https://github.com/facebook/igl. It provides a lean cross-platform graphics API running on top of Vulkan 1.3.

GitHub

LightweightVK is a deeply refactored bindless-only fork of

IGL

which is designed to run on top of Vulkan 1.3 with optional mesh shaders and ray tracing support.

The main goals of LightweightVK:

Lean. Minimalistic API without bloat (no std::vector, std::unordered_map etc in the API).

Bindless. Utilize Vulkan 1.3+ dynamic rendering, descriptor indexing, and buffer device address features for modern bindless-only API design. Ray tracing features are fully integrated with the bindless-only design.

Agile. A playground for experiments to enable quick exploration of ideas and adoption of Vulkan API changes.

Multilingual. In addition to raw SPIR-V, there's built-in support for Glslang (GLSL) and Slang shaders, which is invaluable for rapid prototyping.

Designed for rapid prototyping of modern Vulkan-based renderers.

There are no plans to keep this fork in sync with the IGL upstream, since the API was completely redesigned in a bindless manner.

Discord:

https://discord.com/invite/bEyHyKCrvq

Supported rendering backends

Vulkan 1.3 (Windows, Linux, MacOS, Android) mandatory VK_KHR_dynamic_rendering_local_read

mandatory VK_KHR_maintenance5

mandatory VK_KHR_push_descriptor

mandatory VK_EXT_surface_maintenance1

optional VK_KHR_maintenance6

optional VK_KHR_acceleration_structure

optional VK_KHR_ray_tracing_pipeline

optional VK_KHR_ray_query

optional VK_KHR_fragment_shading_rate

optional VK_EXT_fragment_density_map

optional VK_EXT_fragment_density_map2

optional VK_EXT_dynamic_rendering_unused_attachments

optional VK_EXT_host_image_copy

optional VK_EXT_layer_settings

optional VK_EXT_mesh_shader

Supported platforms

Linux

Windows

MacOS (via KosmicKrisp)

Android

API Support

WindowsLinuxMacOSAndroidVulkan 1.3✔️✔️✔️✔️VK_KHR_acceleration_structure✔️✔️✔️VK_KHR_ray_tracing_pipeline✔️✔️✔️VK_KHR_ray_query✔️✔️✔️VK_EXT_mesh_shader✔️✔️✔️OpenXR 1.1✔️On MacOS, KosmicKrisp and VulkanSDK 1.4.357+ are required.

Build

Before building, run the deployment scripts:

python3 deploy_content.py python3 deploy_deps.py These scripts download external third-party dependencies. Please check

LICENSE.md

for the full list.

Windows

cd build cmake .. -G "Visual Studio 18 2026" Linux

sudo apt-get install clang xorg-dev libxinerama-dev libxcursor-dev libgles2-mesa-dev libegl1-mesa-dev libglfw3-dev libglew-dev libstdc++-12-dev extra-cmake-modules libxkbcommon-x11-dev wayland-protocols cd build cmake .. -G "Unix Makefiles" ❗ Use cmake .. -G "Unix Makefiles" -DLVK_WITH_WAYLAND=ON to build for Wayland, X11 is used by default.

MacOS

❗ Be sure that VulkanSDK 1.4.357+ for MacOS is installed

https://vulkan.lunarg.com/sdk/home#mac

cd build cmake .. -G "Xcode" Android

❗ Be sure that

Android Studio

is set up.

❗ Be sure that the ANDROID_NDK environment variable points to your Android NDK.

❗ Be sure that the JAVA_HOME environment variable is set to the path of the Java Runtime.

❗ Be sure that the adb platform tool is in the PATH environment variable.

cd build cmake .. -DLVK_WITH_SAMPLES_ANDROID=ON cd android/001_HelloTriangle # or any other sample ./gradlew assembleDebug # or assembleRelease You can also open the project in Android Studio and build it from there.

Before running demo apps on your device, connect the device to a desktop machine and run the deployment script:

python3 deploy_content_android.py NOTE: To run demos on an Android device, it should support Vulkan 1.3. Please check

https://vulkan.gpuinfo.org/listdevices.php?platform=android

NOTE: At the moment, demo apps do not support touch input on Android.

Using the Slang compiler

By default, the

Slang

compiler is disabled, and only GLSL shaders are supported through the

glslang

compiler. To enable

Slang

, configure the project with the following CMake option:

cmake .. -DLVK_WITH_SLANG=ON Screenshots

Check out

https://github.com/corporateshark/lightweightvk/samples

.

A comprehensive set of examples can be found in this repository

3D Graphics Rendering Cookbook: 2nd edition

and in the book

Vulkan 3D Graphics Rendering Cookbook - 2nd Edition

.

Vulkan 3D Graphics Rendering Cookbook
Vulkan 3D Graphics Rendering Cookbook
image
image
Solar System Demo
Solar System Demo

Interop with raw Vulkan API calls

The header file lvk/vulkan/VulkanUtils.h offers a collection of functions that allow you to access the underlying Vulkan API objects from LightweightVK handles. This makes it easy to mix LVK and Vulkan code, as shown in the following example:

lvk::Holder<lvk::BufferHandle>vertexBuffer=ctx_->createBuffer({...}); ... lvk::ICommandBuffer&buffer=ctx_->acquireCommandBuffer(); VkCommandBuffercmdBuf=getVkCommandBuffer(buffer); VkBufferbuf=getVkBuffer(vertexBuffer); vkCmdUpdateBuffer(cmdBuf, buf, 0, sizeof(params), &params); ctx_->submit(buffer, ctx_->getCurrentSwapchainTexture());If you'd like to add more helper functions, feel free to submit a pull request.

License

LightweightVK is released under the MIT license, see

LICENSE.md

for the full text as well as third-party library acknowledgements.