LightVK 1.0.3

dotnet add package LightVK --version 1.0.3
                    
NuGet\Install-Package LightVK -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LightVK" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LightVK" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="LightVK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LightVK --version 1.0.3
                    
#r "nuget: LightVK, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LightVK@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LightVK&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=LightVK&version=1.0.3
                    
Install as a Cake Tool

LightVK: Lightweight Vulkan C# Low-Level Bindings

License: MIT NuGet GitHub NuGet Package

LightVK is a lightweight set of low-level Vulkan bindings for C#, automatically generated from the official vk.xml specification. It provides C# developers with near-native performance access to Vulkan APIs.

For the complex procedural steps of Vulkan, LightVK offers lightweight abstract encapsulation that simplifies development while preserving native flexibility.

Wiki: https://deepwiki.com/unknowall/LightVK

Core Features

  • Full Vulkan Support: Covers core functionality across all Vulkan versions from 1.0 to 1.4
  • Complete Extensions: Supports all official Vulkan extensions
  • Cross-Platform: Compatible with three major platforms: Windows, Linux, and Android
  • Dependency-Free: No third-party NuGet dependencies, only relies on the system Vulkan runtime
  • Production-Grade: Implemented in the PS1 emulator ScePSX

Quick Start

Environment Requirements

  • Hardware: GPU supporting Vulkan 1.0+ (NVIDIA GTX 900+/AMD HD 7000+/11th Gen Intel Core integrated graphics and above)
  • System: Windows 7+ / Linux (Ubuntu 14.04+/Fedora 23+) / Android 7.0+
  • Runtime: .NET 8.0+
  • Dependencies: Vulkan SDK (development environment only)

Installation & Compilation

# Clone the repository
git clone https://github.com/unknowall/LightVK.git

# Navigate to the project directory
cd LightVK

# Compile
dotnet build LightVK.sln

Basic Usage Example (Device Initialization)

using LightVK;
using static LightVK.VulkanDevice;
using static LightVK.VulkanNative;

// Create a Vulkan device instance
var device = new VulkanDevice();

// Initialize the device (Windows platform example)
IntPtr windowHandle = /* Your window handle */;
IntPtr instanceHandle = /* Your instance handle */;
...
// 2. Initialize VulkanDevice
device.VulkanInit(windowHandle, instanceHandle, enableValidation: true);
...
// 3. Create RenderPass
_renderPass = _device.CreateRenderPass(
_device.ChooseSurfaceFormat().format,
VkAttachmentLoadOp.VK_ATTACHMENT_LOAD_OP_CLEAR,
VkImageLayout.VK_IMAGE_LAYOUT_UNDEFINED,
VkImageLayout.VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
...
// 4. Create SwapChain
_swapChain = _device.CreateSwapChain(_renderPass, 800, 600);
...
// 5. Create Vertex Buffer
var vertices = new[]
{
 new Vertex(-0.5f, -0.5f, 1.0f, 0.0f, 0.0f), // Red
 new Vertex(0.5f, -0.5f, 0.0f, 1.0f, 0.0f),  // Green
 new Vertex(0.0f, 0.5f, 0.0f, 0.0f, 1.0f)    // Blue
};
vertexBuffer = _device.CreateBuffer( (ulong)(vertices.Length * Marshal.SizeOf<Vertex>()),
 VkBufferUsageFlags.VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VkBufferUsageFlags.VK_BUFFER_USAGE_TRANSFER_DST_BIT);
......

Run the Demo

The project includes a built-in VulkanDevice demo program that demonstrates the basic rendering process:

  1. After compiling the solution, set the Demo project as the startup project
  2. Run the program to see basic rendering effects
  3. The demo includes: window creation, device initialization, render pass/swap chain configuration, and basic drawing flow <img width="802" height="632" alt="DEMO" src="https://github.com/user-attachments/assets/565962ea-2793-438b-9a4a-dd7c7c1b502a" />

Key Modules

Module Description
VulkanNative Low-level API bindings (commands, enums, structs, etc.)
VulkanTypes Basic data type encapsulation (VkExtent2D, VkRect2D, etc.)
VulkanDevice Device management and resource encapsulation (render pipelines, swap chains, etc.)
VkGen Tool to auto-generate binding code from vk.xml

License

This project is open-source under the MIT License. See LICENSE.txt for details. Free for use, modification, and distribution (including commercial projects).

Contribution

Contributions via PR or Issues are welcome:

  1. Fork this repository
  2. Create a feature/bugfix branch
  3. Commit your code with clear descriptions of changes
  4. Submit a Pull Request

Follow the existing code style, ensure cross-platform compatibility, and add comments/tests when necessary.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 87 2/21/2026
1.0.2 89 2/11/2026
1.0.0 101 1/2/2026