NoGraphicsAPI README

The project's README from github.com/sebbbi/NoGraphicsAPI. As one markdown file: README.md.

NoGraphicsAPI

NoGraphicsAPI is an experimental Vulkan 1.4 implementation of the ideas in Sebastian Aaltonen's No Graphics API. It explores how much of a conventional graphics API disappears when shaders use 64-bit GPU pointers, texture and sampler descriptors live in application-owned GPU memory, and synchronization describes hazards instead of resource state.

The Vulkan backend is implemented and exercised by three example applications. Metal support is not implemented; the Metal 4 design records the proposed mapping and open issues.

How it maps to No Graphics API

The design comparison separates faithful mappings, Vulkan-driven differences, and features that remain outside the prototype.

Vulkan realization

The backend intentionally creates no VkDescriptorSetLayout, VkDescriptorPool, VkDescriptorSet, or VkPipelineLayout. Its central extensions are:

NoGraphicsAPI is a low-level, thin Vulkan wrapper. Debug builds enable VK_EXT_debug_utils and the Khronos validation layer when available.

Vulkan 1.4 supplies buffer device addresses, timeline semaphores, dynamic rendering, synchronization2, scalar block layout, and the remaining core features. See Vulkan support for the concise feature and command mapping.

GPU memory and descriptor heaps

There are no public buffer objects or internal suballocators. Applications own data and descriptor heaps; optimal-tiled textures use separate GPU-only heaps. The optional utility library provides application-side data and texture allocation policies.

GpuRange is the non-owning address/size view used by commands. Texture and sampler descriptors are addressed in Slang through the standard heap syntax:

Texture2D<float4> texture = ResourceDescriptorHeap[texture_index];
SamplerState sampler = SamplerDescriptorHeap[sampler_index];
float4 texel = texture.Sample(sampler, uv);

Shared root ABI

Shared scalar, vector, and matrix types come from <NoGraphicsAPIUtility/shader_types.h>. Root structures are declared once and included by C++ and Slang:

struct RootArguments
{
    Vertex* vertices;
    float4x4 mvp;
};

On the CPU, pointer fields receive GPU virtual addresses while ordinary values are copied directly:

GpuCpuRange<Vertex> vertex_memory = bump_allocator.allocate<Vertex>(vertex_count);
RootArguments root{
    .vertices = vertex_memory.gpu,
    .mvp = mvp,
};
gpu::draw(commands, root, vertex_count);

Slang declares the same root as push-constant data and reads both pointer and value fields directly:

[[vk::push_constant]] ConstantBuffer<RootArguments> root;

Vertex vertex = root.vertices[vertex_id];
float4x4 mvp = root.mvp;

The draw or dispatch copies the root bytes immediately through vkCmdPushDataEXT; the root does not need to outlive the call. Shared structures use C layout, and matrix-bearing roots use row-major matrix layout. Root values must be trivially copyable, have a size divisible by four, and be no larger than DeviceCaps::max_push_data_size.

Public descriptor structures have useful defaults. Call sites use C++20 designated initializers to name only fields that differ from those defaults. Span and ByteSpan are non-owning pointer/count views used for function inputs.

The full shader-side contract is in the Slang shader contract.

Build and run

Requirements:

MSVC and clang-cl are supported on Windows. GNU and Clang can build the headless library on other platforms. MinGW, 32-bit x86, and ARM targets are not supported.

The utility implementation is shipped in-tree, so configuration has no Git or network dependency. The default configuration builds NoGraphicsAPI and its companion utility library. Examples and tests are opt-in so embedding NoGraphicsAPI with add_subdirectory() does not add development targets:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build --prefix path/to/install

The same install provides independent NoGraphicsAPI and NoGraphicsAPIUtility packages:

find_package(NoGraphicsAPI CONFIG REQUIRED)
find_package(NoGraphicsAPIUtility CONFIG REQUIRED)
target_link_libraries(my_application PRIVATE
    NoGraphicsAPI::NoGraphicsAPI
    NoGraphicsAPIUtility::math
    NoGraphicsAPIUtility::textures)

NoGraphicsAPIUtility provides shared C++/Slang types, math, data and texture suballocation, and a timeline-driven DeleteQueue. These are optional application-side policies; NoGraphicsAPI does not depend on them. The queue delays allocator reuse and resource destruction until the application timeline completes. BumpAllocator::allocate_atomic() supports relaxed-atomic concurrent reservations from worker threads.

For repository development on Windows, enable the examples and tests explicitly. Building examples requires the Slang and SPIR-V Tools versions listed above.

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DNOGRAPHICSAPI_BUILD_EXAMPLES=ON -DNOGRAPHICSAPI_BUILD_TESTS=ON
cmake --build build
ctest --test-dir build --output-on-failure

The Windows examples use the normal swapchain path:

They can be run from their corresponding directories under build/examples when NOGRAPHICSAPI_BUILD_EXAMPLES is enabled.

Hardware support

Driver support was checked on 5 September 2026 against the latest available packages; linked reports are representative snapshots. create_device() remains authoritative; Vulkan 1.4 alone does not provide the required new extensions.

The latest available Windows drivers are AMD Adrenalin 26.9.1 and NVIDIA 616.64 WHQL.

Architecture Current driver Products CPU-visible heap Required extensions
AMD RDNA 2 (dGPU) Windows / Adrenalin 26.9.1 RX 6000 PCIe ReBAR or
🔴 256 MiB fixed BAR
🔴 Unsupported
AMD RDNA 2 (iGPU) Windows / Adrenalin 26.9.1 600M UMA 🔴 Unsupported
AMD RDNA 2 (iGPU) Linux / Mesa RADV 26.2+ Steam Deck UMA Supported
AMD RDNA 3 (dGPU) Windows / Adrenalin 26.9.1 RX 7000 PCIe ReBAR Supported
AMD RDNA 3 (iGPU) Windows / Adrenalin 26.9.1 700M UMA Supported
AMD RDNA 4 (dGPU) Windows / Adrenalin 26.9.1 RX 9000 PCIe ReBAR Supported
NVIDIA Turing Windows / NVIDIA 616.64 GTX 1600 🔴 256 MiB fixed BAR (214 MiB exposed) Supported
NVIDIA Turing Windows / NVIDIA 616.64 RTX 2000 🔴 256 MiB fixed BAR (214 MiB exposed) Supported
NVIDIA Ampere Windows / NVIDIA 616.64 RTX 3000 PCIe ReBAR Supported
NVIDIA Ada Lovelace Windows / NVIDIA 616.64 RTX 4000 PCIe ReBAR Supported
NVIDIA Blackwell Windows / NVIDIA 616.64 RTX 5000 PCIe ReBAR Supported

🔴 marks missing required extensions or a capacity-limited fixed BAR. All checked ReBAR GPUs expose their main VRAM heap as CPU-visible; availability depends on platform firmware. A fixed BAR can still satisfy the memory requirement, but limits the default CPU-visible heaps; GPU-only allocations can use separate VRAM.

Checked UMA heap sizes are 5.1 GiB on a Windows Radeon 680M, 5.8 GiB on Steam Deck, and 21.2 GiB on a Windows Radeon 780M; they vary with system configuration.

Current Windows RDNA 2 reports lack VK_EXT_descriptor_heap; the checked RDNA 3 and RDNA 4 AMD GPUs and all listed NVIDIA GPUs advertise every required extension. With Mesa RADV 26.2 or newer, Steam Deck also has all required extensions. Linux/SteamOS window presentation is not implemented yet and is planned for a near-term update.

🔴 Pascal / GeForce GTX 10 is below the NVIDIA floor: it lacks all four new extensions and exposes a 214 MiB fixed BAR.

Intel Windows support is not verified. The latest public Arc report lacks the descriptor-heap, device-address-command, and shader-untyped-pointer extensions. Mesa ANV 26.2 or newer exposes the required extensions on Linux, but this repository currently lacks Linux swap chain support (to be implemented).

Current scope

The library has been reviewed with GPT-6 Astra Ultra, but remains a prototype and may contain bugs. Please report issues.

Implemented today: graphics, mesh, and compute PSOs; direct and indirect work; GPU-address copies; application-owned descriptor heaps; common texture types and views; dynamic rendering and viewport/scissor/depth-stencil state; global barriers; timeline submission; deferred destruction; and Win32 presentation.

This is a deliberately single-threaded, single-queue graphics API. Ray tracing, task shaders, sparse memory, device-generated command graphs beyond the existing indirect operations, pipeline caching, MSAA, non-Win32 presentation, and a Metal backend are outside the current implementation. The public header remains the source of truth for the exact API surface.

Further reading:

License

NoGraphicsAPI and NoGraphicsAPIUtility are distributed under the MIT License. The cube example's texture is derived from Vulkan-Tools and is redistributed under Apache-2.0. See third-party notices for complete attribution and license details.

NoGraphicsAPI (sebbbi/NoGraphicsAPI)

Searching Database…

这是什么?NoGraphicsAPI 是对 Sebastian Aaltonen “无图形 API” 理念的一个实验性 Vulkan 1.4 实现,探索当着色器改用原始 64 位 GPU 指针而非缓冲对象和绑定时,传统图形 API 里有哪些东西随之消失。
它是游戏引擎,还是只是一个封装库?它是一个极简的底层 C++ 库——一层薄薄的 Vulkan 封装,没有引擎级抽象、描述符集或管线布局,并不是完整的引擎或框架。
怎么构建它?用 CMake 配置并构建;默认只构建 NoGraphicsAPI 和 NoGraphicsAPIUtility 这两个库,triangle、cube 和 deferredrenderer 示例应用以及测试需要你显式打开对应的开关。
构建之前需要装什么?CMake 3.24+、C++20 编译器,以及小端 x86-64 目标平台上 1.4.357 或更新版本的 Vulkan SDK 头文件/库;构建示例应用还需要 Slang 2026.14.1+ 和 SPIRV-Tools 2026.3+。
它能在我的任何 Vulkan GPU 上跑吗?不能——它需要一些较新的特定 Vulkan 扩展(描述符堆、设备地址命令、无类型指针、网格着色器),很多现有驱动都不具备;目前的 Windows RDNA2 驱动和 Turing 之前的 NVIDIA GPU 都不提供这些扩展。
除了 Windows,它也能在 Linux 上跑吗?自带的需要窗口呈现的示例应用目前只能在 Windows 上运行;无头库可以在其他平台上用 GNU/Clang 编译,但 Linux/SteamOS 的窗口呈现还没实现。
它需要什么样的显存?它需要 CPU 可见的连贯 GPU 内存——独立显卡走 PCIe ReBAR,核显走 UMA——另外还需要兼容的设备本地内存来放缓冲区和纹理。
三个示例应用分别是什么?Triangle 是最小的顶点/片元绘制与呈现路径;cube 展示基于类型化 GPU 指针的顶点获取和由应用管理的纹理/采样器堆;deferredrenderer 跑一个多通道 GPU 计算加网格着色器的工作负载,用基于指针的场景数据和由 timeline 管理的 CPU/GPU 重叠。
除 Vulkan 之外还支持 Metal 吗?不支持,Metal 支持没有实现。文档里记录了一个拟议的 Metal 4 映射方案和它的未决问题,但今天真正能用的只有 Vulkan 后端。
为什么没有描述符集和管线布局?这个设计用 64 位 GPU 指针和应用自管理的描述符堆取代了传统绑定,所以后端根本不会创建 VkDescriptorSetLayout、VkDescriptorPool、VkDescriptorSet 或 VkPipelineLayout。
不用常量缓冲区的话,数据怎么传给着色器?一个小的共享 C++/Slang 根结构体在每次绘制或 dispatch 时经 vkCmdPushDataEXT 推送;它的指针字段携带 GPU 地址,普通值则直接复制,而且根结构体不必在调用结束后继续存活。
Creator
sebbbi
Size
0.8 MB
Stars
1.6K
Updated
CommitOct 06
Age
1mo
Commits · 90 Days