Skip to content

JDSherbert/Sherbert-Vulkan-Renderer-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Sherbert Vulkan Renderer Template

Stars Badge Forks Badge Watchers Badge Issues Badge


Vulkan Template License




Overview

Sherbert Vulkan Renderer Template is a lightweight Vulkan renderer starter project designed to get developers rendering as quickly as possible.

Rather than spending hours implementing Vulkan boilerplate before seeing anything on screen, this template provides a complete working renderer with the core setup already implemented. The project creates a Vulkan instance, selects a graphics device, creates a swapchain, configures a render pass and graphics pipeline, records command buffers, and presents a rendered triangle.

The goal of this repository is to provide a clean and understandable foundation for learning Vulkan or starting a custom rendering engine. The code is intentionally kept simple and exposed, allowing developers to follow the flow of Vulkan initialization without navigating through unnecessary engine abstractions.

Unlike many Vulkan tutorials, this template includes complete vertex and fragment shaders (triangle.vert and triangle.frag) alongside the renderer code. This means the entire path from application startup to GPU execution is included, making it easier to understand how Vulkan pipelines, shader stages, and rendering commands work together.

Learning Resources

This repository is intended to be a practical starting point for learning Vulkan.

Included examples:

  • Vulkan instance creation
  • Physical and logical device setup
  • Swapchain management
  • Render pass creation
  • Graphics pipeline setup
  • Vertex and fragment shader stages
  • Command buffer recording
  • Frame presentation

The included triangle renderer provides a complete minimal example of the Vulkan rendering pipeline from CPU-side setup through to GPU execution.

Features

  • Vulkan 1.1 renderer setup
  • Win32 window surface creation
  • Physical & logical device selection
  • Graphics queue initialization
  • Swapchain creation
  • Swapchain image views
  • Render pass creation
  • Graphics pipeline creation
  • Command buffer recording
  • Triangle rendering
  • Presentation to the swapchain
  • Modern C++ project structure
  • CMake build system

Getting Started

Requirements

  • C++20 compatible compiler
  • CMake 3.20+
  • Vulkan SDK
  • Git

Building

git clone https://github.com/JDSherbert/Sherbert-Vulkan-Renderer-Template.git
cd Sherbert-Vulkan-Renderer-Template

cmake -B Build
cmake --build Build --config Release

Shader Compilation

This template uses Vulkan's SPIR-V shader format. The included GLSL shaders:

Shaders/
├── triangle.vert
└── triangle.frag

are automatically compiled into SPIR-V bytecode during the CMake build process. The project uses glslangValidator from the Vulkan SDK to perform this conversion. Make sure the Vulkan SDK is installed and that glslangValidator is available in your system PATH. You can verify this by running:

glslangValidator --version

If the command is not found, add the Vulkan SDK Bin directory to your PATH.

Releases

No releases published

Packages

 
 
 

Contributors