Skip to main content

VkForge: A Vulkan User-End API Implementation Generator for Renderer Development

Project description

VkForge - Vulkan End-User API Implementation Generator

PyPI version License: MIT

VkForge is a lean Vulkan code generator that helps you write Vulkan applications faster by generating boilerplate implementations. It gives you direct control over Vulkan while automating repetitive setup code.

Why Use VkForge?

  • Write real Vulkan code - No hidden abstractions or magic
  • Save development time - Generate Vulkan boilerplate instantly
  • Small and focused - C99 code, C++ compatible
  • Flexible usage - Pick only what you need
  • SDL3 integration - With plans for more platform support
// Example: Get started quickly
#include "vkforge_typedecls.h"  // Generated type declarations
#include "vkforge_funcdecls.h"  // Generated function declarations

int main() {
    SDL_Window* window = SDL_CreateWindow("App", 800, 600, SDL_WINDOW_VULKAN);
    VkForgeCore* core = VkForge_CreateCore(window, 0, 0); // Convenience creator for core Vulkan objects
    VkForgeRender* render = VkForge_CreateRender(/*...*/); // Object designed for rending with Vulkan
    
    while(running) {
        VkForge_UpdateRender(render); // Handles Vulkan complexity
    }
}

Key Features

Automatic Vulkan Implementation

  • Generates Vulkan initialization code (instance, device, swapchain)
  • Creates pipelines from your shaders
  • Builds descriptor layouts automatically
  • Uses glslangValidator (from Vulkan SDK) for GLSL compilation

Helpful Utilities

  • Basic texture loading via SDL3_image
  • Memory management helpers
  • Synchronization utilities
  • Dynamic rendering (Vulkan 1.3)

Flexible Generation

  • Generate complete implementations or just specific components
  • Mix generated and handwritten code
  • Update pipelines as shaders change

How It Works

VkForge generates clean C code by analyzing:

  1. Your Shaders (SPIR-V / GLSL source (compiled automatically))
  2. Your Configuration (YAML format)
# Example vkforge.yml
ID: VkForge 0.5

Pipeline: # Atleast one pipeline to generate pipeline code and layout code
  - name: MainPipeline
    ShaderModule: # layouts are automatically designed from shader combinations
      - path: shaders/main.vert 
      - path: shaders/main.frag
    VertexInputBindingDescription: # describe how vertex locations are binded to buffers
      - stride: sizeof(Vertex) # Can be Type, Sizeof or Integer
        first_location: 0

Getting Started

  1. Install VkForge:
pip install vkforge
  1. Ensure glslangValidator is in your PATH (comes with Vulkan SDK)

  2. Create your config file and run:

vkforge config.yml --source-dir src --build-dir build
  1. Use the generated code:
#include "vkforge_typedecls.h"
#include "vkforge_funcdecls.h"

void DrawCallback(VkForgeRender render) {
    VkForge_BindPipeline(render.userData, "MainPipeline", render.drawCmdBuf);
    vkCmdDraw(render.drawCmdBuf, 3, 1, 0, 0);
}

Usage Patterns

VkForge is designed to be flexible:

  • Starter Template - Generate all code once and modify manually
  • Pipeline Updates - Regenerate only pipelines when shaders change
  • Partial Adoption - Use only specific generated components
  • Convenience Components - Provide automatic layout design and render management
# Generate certain files just once
GenerateOnce:
- CMakeLists.txt
- vkforge_core.c

Current Limitations

  • Vulkan 1.3 with dynamic rendering only (renderpass support planned)
  • SDL3 platform support (others planned)
  • Basic feature set (see roadmap below)

Roadmap

Help wanted on these features! Contribute via pull requests or ideas.

  • Optimize Design layout to only store unique data globally
  • Add support for push constants
  • Add support for subpass inputs
  • Add support for Renderpass (pre-1.3 Vulkan)
  • Platform abstraction (Raylib, GLFW support)
  • Alternative texture loading backends (stb_image)
  • 3D utility functions
  • Extended utility functions with pNext and pAllocator support ??

Community & Contribution

VkForge is open source and MIT licensed. We welcome all contributions!

  • Try it out and report issues
  • Help implement roadmap features
  • Improve documentation
  • Share with others who might find it useful

🔗 GitHub Repository
📦 PyPI Package
💬 Discussions

Why VkForge?

Vulkan is powerful but requires lots of boilerplate. VkForge helps by:

  • Generating the repetitive code
  • Providing useful components
  • Providing convenient utility functions
  • Keeping you in control of the Vulkan API
  • Staying out of your way when you don't need it

Small. Focused. Flexible.

(c) 2025 Alrick Grandison, Algodal

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vkforge-0.5.6-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

Details for the file vkforge-0.5.6-py3-none-any.whl.

File metadata

  • Download URL: vkforge-0.5.6-py3-none-any.whl
  • Upload date:
  • Size: 52.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for vkforge-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3582a1b4fca55fb25751f2faaea3d85667fa92b76e25d5121bd63dd9c2ad7531
MD5 8f7510f7fe01c15350a7d50df13d4640
BLAKE2b-256 6270f420a0e3ba579c65ec9be1e4acc10d357a8e500e7989063ca5cfb6209731

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page