r/GraphicsProgramming
•
u/No_Grapefruit1933
•
Dec 23 '25
•
1
"No Graphics API" Vulkan Implementation
I was feeling very inspired by Sebastian Aaltonen's "No Graphics API" blog post, so this is my attempt at implementing the proposed API on top of Vulkan. I even whipped up a prototype shading language for better pointer syntax. Here's the source code for those curious:
21
u/Gobrosse Dec 23 '25
7
u/No_Grapefruit1933 Dec 23 '25
I think there are some things that could justify a custom language/generator, like I autogenerate push constants that I use in the backend, but yeah I suppose you can use VCC (which I've never heard of until now). I mostly did it for fun
3
u/Gobrosse Dec 23 '25 edited Dec 23 '25
is your toy language matching odin's syntax ? the compiler library behind Vcc (shady) is language-agnostic, you might be interested in it, i'm scheduled to give a talk about it at the next Vulkanised shader symposium
1
6
u/aleques-itj Dec 24 '25
I keep the side of my case off so my graphics card can hear me speak and after it learns enough English I can whisper vertices to it
1
u/fooib0 Jan 16 '26
This looks like a very cool project! Great work.
Are there any projects in the wild that are already using vcc or shady? Are there any tutorials for how to use it for rendering (vertex + fragment shaders)?
2
u/Gobrosse Jan 17 '26
We published a paper at HPG25, we included a simple rendering example: https://github.com/shady-gang/imr/tree/hpg_demo/hpg_demo/shaders
3
u/fooib0 Jan 17 '26
Cool work. What's the reason for getting rid of PSOs?
2
u/No_Grapefruit1933 Jan 17 '26
It was an impulsive decision because I personally find them annoying to deal with lol. I hate having lots of intertwined objects I have to manage the lifetime of. With this project my priority was readability and usability. Though the pipelines outlined in the original blog aren't as bad as the ones you see today in Vulkan etc.
1
u/fooib0 Jan 17 '26
How much of a performance hit is not having PSOs?
2
u/No_Grapefruit1933 Jan 17 '26
I'm not sure, haven't done any real measurement yet, but I have heard that the shader object extension (which allows you to get rid of pipelines) was added to Vulkan to get better performance on the Nintendo Switch, so I think it could be a performance win in some cases. I feel like it would also eliminate the shader compilation stutter issues that have been plaguing PC gaming.
13
u/delta_p_delta_x Dec 23 '25 edited Dec 24 '25
Here is the sort of thing that comes along every now and then, and makes me feel extremely stupid.
This is amazing; well done.
7
u/fireantik Dec 24 '25
This is really impressive. I really hope it goes somewhere because the api outlined in the blog post just makes so much sense. That said, the custom shading language does seem like something orthogonal and it would make more sense to me to integrate Slang or some other existing language. Also Odin is great!
4
0
Dec 24 '25
[deleted]
4
u/No_Grapefruit1933 Dec 24 '25
I don't think it's controversial to say graphics APIs are a mess, I think most people would agree (or at least I hope). Regarding AI, I think it's fine to ask the AI a few things, I do it sometimes, I just think you shouldn't use it for everything
5
Dec 25 '25
[removed] — view removed comment
1
u/No_Grapefruit1933 Dec 25 '25
Oh, nice! Looks very similar to mine. Looks like you also have an expensive lookup to convert from pointers to handles
2
Dec 25 '25 edited Dec 25 '25
[removed] — view removed comment
1
u/No_Grapefruit1933 Dec 25 '25
I'm actually using a red black tree (odin has one in its stdlib so it was quick for me). I was mainly concerned about this lookup being in draw_indexed_instanced since that could be called thousands of times per frame, though with an API this flexible it's probably very easy to batch draw calls together or even have a single draw call for everything, now that i think about it.
1
Dec 25 '25
[removed] — view removed comment
1
u/No_Grapefruit1933 Dec 25 '25
Odin does not support operator overloading, but yeah I suppose you could in general make the API slightly more complicated so that this doesn't happen
46
u/possiblyquestionabl3 Dec 23 '25
Wow, did you do all of this in just the last week since that blog post came out?