Repolode
sebbbi

sebbbi/NoGraphicsAPI

A minimal C++20 graphics library for Metal 4 and Vulkan 1.4 that replaces buffers and descriptor sets with GPU pointers and descriptor heaps.

Stars
1,708
Forks
61
Open issues
6
Last commit
8 hours ago

What is it?

NoGraphicsAPI is a low-level C++20 graphics library that implements the ideas from Sebastian Aaltonen's "No Graphics API" proposal. Instead of creating buffer objects, vertex layouts and descriptor sets, applications allocate GPU memory from heaps, pass 64-bit GPU pointers to shaders, and reference textures and samplers by indices in application-owned descriptor heaps.

Each draw or dispatch receives a single GPU pointer to a root structure shared between C++ and Slang shaders. The structure can hold pointers to vertex data, materials, constants and texture indices, so vertex shaders fetch their own vertices and no pipeline or binding layouts need to be maintained. Barriers describe producer and consumer work rather than resource transition lists, and the application still owns allocation, lifetime and synchronization.

The library supports Metal 4 on Apple silicon devices running macOS, iOS or iPadOS 26+, and Vulkan 1.4 with VK_EXT_descriptor_heap and VK_EXT_mesh_shader on Windows and Linux. Windows and macOS include windowed examples, while Linux currently supports headless use.

Key features

  • 01Allocates GPU memory from heaps without public buffer objects, and mapped heaps give both CPU and GPU addresses.
  • 02Shaders access data through typed 64-bit GPU pointers shared with C++ structures.
  • 03Bindless textures and samplers are indexed through application-owned descriptor heaps.
  • 04Each draw or dispatch uses one GPU root pointer, avoiding descriptor-set and pipeline layouts.
  • 05Shaders are written in Slang and shared between the Metal and Vulkan backends.

Use cases

  • Building a custom renderer that wants direct control over GPU memory and binding.
  • Experimenting with bindless rendering and GPU-driven data layouts on Metal 4 or Vulkan 1.4.
  • Studying a concrete implementation of the "No Graphics API" ideas in C++ and Slang.

Quick start

  1. 1

    Install Xcode 26+ with its Metal compiler, CMake, and Slang 2026.18.2+

  2. 2

    Configure the build with examples and tests enabled

    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=macosx -DNOGRAPHICSAPI_BUILD_EXAMPLES=ON -DNOGRAPHICSAPI_BUILD_TESTS=ON -DNOGRAPHICSAPI_SLANGC=/path/to/slangc
  3. 3

    Build the project

    cmake --build build
  4. 4

    Run the triangle example

    build/examples/triangle/example_triangle

Things to know

  • Metal backend requires macOS, iOS or iPadOS 26+ and Apple GPU family 7 or newer; Intel Macs are not supported.
  • Vulkan backend needs Vulkan 1.4 plus VK_EXT_descriptor_heap and VK_EXT_mesh_shader, which many GPUs lack.
  • Linux currently supports headless use only, with no windowed examples.

In collections

Topics

FAQ

What is NoGraphicsAPI?
A minimal C++20 graphics library for Metal 4 and Vulkan 1.4 that replaces buffers and descriptor sets with GPU pointers and descriptor heaps. NoGraphicsAPI is a low-level C++20 graphics library that implements the ideas from Sebastian Aaltonen's "No Graphics API" proposal. Instead of creating buffer objects, vertex layouts and descriptor sets, applications allocate GPU memory from heaps, pass 64-bit GPU pointers to shaders, and reference textures and samplers by indices in application-owned descriptor heaps.
Is NoGraphicsAPI free to use? What license does it have?
NoGraphicsAPI is open source under the MIT license. Check the license terms before using it in commercial products.
Is NoGraphicsAPI still maintained?
Actively maintained. The last commit to NoGraphicsAPI was on Nov 7, 2026.
What can I use NoGraphicsAPI for?
Building a custom renderer that wants direct control over GPU memory and binding. Experimenting with bindless rendering and GPU-driven data layouts on Metal 4 or Vulkan 1.4. Studying a concrete implementation of the "No Graphics API" ideas in C++ and Slang.
How do I install NoGraphicsAPI?
Install Xcode 26+ with its Metal compiler, CMake, and Slang 2026.18.2+ Configure the build with examples and tests enabled: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=macosx -DNOGRAPHICSAPI_BUILD_EXAMPLES=ON -DNOGRAPHICSAPI_BUILD_TESTS=ON -DNOGRAPHICSAPI_SLANGC=/path/to/slangc Build the project: cmake --build build Run the triangle example: build/examples/triangle/example_triangle
Where can I get NoGraphicsAPI?
The source code and installation instructions are on GitHub: https://github.com/sebbbi/NoGraphicsAPI

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects