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.cmdbuf_draw);
    vkCmdDraw(render.cmdbuf_draw, 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 ??
  • Ensure VkForge support both Graphs and Compute GPU activities

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.6.0-py3-none-any.whl (58.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vkforge-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 58.5 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8acb48732afbe0e509fecdab4ef9c094a9959cacfdd81b658d76a26fe1fc878
MD5 66e7a6c48ef386f7d5ae3c10ff07c1c2
BLAKE2b-256 eb707e432c6fb55f77948da0ac133109632206f24320a966b81fd9961c03acb9

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