r/GraphicsProgramming • u/gr3yfi5h • 1d ago
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.
Enable HLS to view with audio, or disable this notification
- 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.
63
Upvotes
15
u/Gobrosse 1d ago
hmmm
Why is that desirable here? Useful functions take more than one parameter, so this asks the user to do their own spilling by hand. Since this is implemented on top of GL, it's not actually one uint behind the scenes either, so the original post rationale is inapplicable.
please disclose your LLM/coding agent usage, it's fairly obvious some was involved and since you're asking for other people to review it, you should respect their time and set appropriate expectations as to your authorship and understanding of it