Hasty Briefsbeta

Bilingual

Writing a bindless GPU abstraction layer

4 hours ago
  • #GPU API Design
  • #Bindless Rendering
  • #Graphics Programming
  • Sebastian Aaltonen's blog 'No Graphics API' inspired the Loon GPU project, which simplifies modern graphics APIs by using GPU pointers everywhere, eliminating buffer objects, vertex buffers, and explicit bind groups.
  • Loon GPU provides a pointer-first API where GPU memory is allocated via malloc and freed with free, supporting different memory types (CPU-mapped, GPU-local) and uses device pointers for shader arguments, with internal buffer creation in Vulkan and Metal backends.
  • Shaders are designed to be bindless, with inputs from a single pointer, but face challenges in cross-platform compatibility, especially with Slang for Vulkan and Metal, requiring workarounds for push constants and threadgroup sizes.
  • Bindless textures and samplers are natively supported in Metal, while Vulkan uses a large binding set with descriptor indexing, removing the need for explicit image layout transitions by using general layout and handling initialization globally.
  • Limitations include unsupported features like decoupled blend state and split barriers due to backend constraints, with future plans for debug support, example expansion, and potential backend improvements via Vulkan extensions.