r/GraphicsProgramming • u/gr3yfi5h • Oct 03 '26
I wanted to understand modern pointer-based GPU APIs, so I took the ideas from Sebastian Aaltonen's NoGraphicsAPI and rebuilt them on plain GL 4.6.
- The whole GPU heap is one persistent, coherent-mapped SSBO. A
gpu_ptr<T>is a u32 byte offset into it. - Every draw gets exactly one root pointer (uniform uint Root). Vertices, matrices and textures are all reached through it.
- No vertex attributes. The vertex shader pulls data from the heap using gl_VertexID.
- Bindless textures (ARB_bindless_texture) are stored in the heap as uvec2.
- One *_shared.h header is compiled as both C++ and GLSL, so no offsets are written by hand in the shaders.
Flat lighting is computed from the dFdx/dFdy of world position, so there are no normals in the vertex data.
The most interesting finding was what GL can't express: bindless only gives you texture+sampler pairs, fixed when the texture is created, and there are no placed resources.
Next up: indirect draws, and roots chosen by the GPU via gl_DrawID.
Repo: https://github.com/theaveasso/jagfx
Feedback welcome, especially on the heap and sync design.
78
Upvotes
View all comments
Show parent comment
-6
u/gr3yfi5h Oct 03 '26
Thanks for taking the time, you're right on all three. I updated the README: it now says GL 4.6 + ARB_bindless_texture, explains that the article's root pointer relies on Vulkan/Metal features GL doesn't have, so on GL it's just auniform (I kept it mainly for multi-draw indirect later), and there's a section saying how I built it with Claude Code and that parts were written with it.
To be upfront: I'm building this purely to learn. I don't have anyone around me who does graphics, so AI has basically been my tutor, and I'm trying to get into the industry eventually. That's also why I posted: real feedback from people who actually know this stuff is what I'm missing.
If you don't mind me asking: for passing per-draw data on GL, would you just use plain uniforms/UBOs for CPU-driven draws and only go through memory for indirect? Or is there something better I should read up on?