#Rosy
1 messages · Page 10 of 1
so you want to separate out your code into dlls
and reload individual bits?
like make your game a bunch of dynamic libraries and a main process?
livepp requires minimal changes to the source (just one line at the start of main iirc). it works by hot patching the code
you change a function, recompile the TU, then livepp will patch all references to functions in that TU
oh do you have to turn off memory address safety
if you try to read the code in memory where your asm is pointing to in the disassembler
it will not be readable
while debugging
pretty sure the debugger still works
it shows you where in visual studio where each line of the assembly code is in memory
no I am saying the operating system prevents it
you have to like turn that off or something idk
address randomization?
no that's different
oh
you do have to change some compiler flags to use livepp
yeah
idk how that all works tbh
there's an address next to each line
that's where the instruction actually exists in memory
if it is writable
you could write and change it directly in the debugger
because you can see your process's virtual memory
but you can't unless you turn the safety off
changing asm in the debugger sounds super cursed
well that's what you're talking about sounds like to me
still less cursed than self modifying code 
I don't think this is what live++ is doing anyway
it's writing to those places in memory
it's not writing to those places
right
well I got a windows window via window apis, time for vulkan init I guess
looks like I just pass in my app and window instance into this:
typedef struct VkWin32SurfaceCreateInfoKHR {
VkStructureType sType;
const void* pNext;
VkWin32SurfaceCreateFlagsKHR flags;
HINSTANCE hinstance;
HWND hwnd;
} VkWin32SurfaceCreateInfoKHR;
and call vkCreateWin32SurfaceKHR
this is easier than SDL tbh :/
not that SDL was hard, but it is a painful library to have build and keep around imo, just extra unecessary steps, and I never built rosy on anything but windows so it was a complete waste of my time to use it
you... interacted with win32? willingly?

ah I used std vector all over the place when initializing vulkan
std::vector<VkLayerProperties> availableLayers(layerCount);
vkEnumerateInstanceLayerProperties(&layerCount, availableLayers.data());
I guess I need to build that allocator
was looking at volk also
vulkan is kind of a shit API lol
oh no
jk jk
maybe I sacrifice BDA and just go with directx12
weren't you writing c
I think I can maybe make the vkGetInstanceProcAddr song and dance a macro though
i should learn vk
well I need a way to allocate memory before I can even query anything
so I'm gonna do that I guess
malloc?
what kinda allocator do you need
yeah I'm going to write my own arena allocator though instead of manually managing memory all over the place
Honestly if you're comfortable using alloca a lot of Vulkan can be done on the stack
at least anything involving the pattern where you query a count of things and then query the things themselves
or if you don't want to do that you could even just allocate a worst-case stack array of them
I've never really used alloca but if I wanted to avoid malloc that's probably what I'd do in this case
and I'd probably get used to it and stop finding it ugly
you know very first ever C++ application I wrote was a vulkan implementation, which is kind of crazy
and now my first ever C application is also a vulkan implementation
I don't recommend a vulkan implementation as a way to learn programming languages tbh
lmao
only vulkan init has this
which I guess is a lot of vulkan if you're making hello triangle
well once I have the allocator and the vulkan loader, the rest of this is going to be trivial
yeah between querying for stuff and passing stack-allocated createInfo structs you can get a long way
the allocation matters more for the actual rendering
yeah, I am going to do my vulkan memory all from scratch, no vma too
this is all the fun part
I wrote a stack allocator just so I wouldn't have to worry about this in my RHI lol
what sort of stack allocator
Like just a regular allocator with heap memory, but operating in a stack data structure?
or an allocator that actually runs on stack memory
heap memory, stack data structure
gotcha
It's fast enough. It's not why my code is slow, so I don't care to optimize it 🙂
(doesn't even show up on the flame graph)
And I'm hitting that region enough frequently enough to where it's not really causing (L2+) cache misses to hit that, so I'm fine with it as is. No need to fix what aint broken 🙂
had some challenges with clangd linting + msvc building and warnings setting up a unity build but it works now, I learned about IWYU pragmas
the lsp has some trouble with understanding, obviously, that a c file that is included by another c file would know about certain names so I'm seeing if I can solve with a #pragma once in a header file that includes deps, I don't see other repos doing this so not sure how they handle it
they just seem happy including things at a top level c file and that does the job for them, probably something I haven't figured out yet
the pragma once seems to work
cl /showIncludes /c main.c
main.c
Note: including file: C:\Users\Bjorn\projects\code\palinode\palinode.h
Note: including file: C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um\windows.h
... more windows and stdio.h includes
Note: including file: C:\Users\Bjorn\projects\code\palinode\palinode.c
it did not then include all that windows stuff all over again
I also looked at the /E output you can see the full output of the translation unit's contents
idk why those other projects don't do that, but seems to work ok
the ai codereview bot hates my unity build, I am going to have to like figure out a directive to tell it not comment on it
I only have ai review my code, I don't use it to write anything
it has saved me from a lot of painful things I overlooked, ai codereview is very valuable
I have to do a lot of extra work just to make clangd lsp work
I have to keep unecessary header files around with forward declarations
I have define a .clangd file that's basically a duplicate of my batch file
only clangd doesn't support environment variables https://github.com/clangd/clangd/issues/1827
so it's worse than a batch file
and I have to hard code the vulkan header location
which the rest of the world references via the environment variable the vulkan sdk itself adds
and their feedback is, have your build system generate the clangd
you know maybe I will have my batch file write the json
cool cool
honestly I should be grateful clangd exists at all, because it does work
progress lol
yea you usually have cmake generate it
why not just do that
I'm not using cmake
I'm so happy
I have a little shoestring arena
#include "common.h"
#include "palinode.h" // IWYU pragma: keep
internal VkResult query_instance_layers(Arena *arena) {
u32 property_count;
VK_CHECK(vkEnumerateInstanceLayerProperties(&property_count, NULL));
DEBUG_PRINT("num instance layers: %d\n", property_count);
VkLayerProperties *layers;
layers = arena_alloc(arena, sizeof(VkLayerProperties)*property_count);
if (layers == NULL) return VK_ERROR_INITIALIZATION_FAILED;
VK_CHECK(vkEnumerateInstanceLayerProperties(&property_count, layers));
for (int i = 0; i < (int)property_count; i++) {
VkLayerProperties layer = layers[i];
DEBUG_PRINT("Instance layer name: %s instance layer description: %s \n", layer.layerName, layer.description);
}
return VK_SUCCESS;
}
VkResult init_gfx(void) {
Arena *arena = init_arena(1024 * 1024 * 256);
if (arena == NULL) return VK_ERROR_INITIALIZATION_FAILED;
VK_CHECK(init_vulkan());
VK_CHECK(query_instance_layers(arena));
deinit_arena(arena);
return VK_SUCCESS;
}
clangd keeps adding includes I don't need
I don't need a build system
definitely not making my project even worse than I have just for clangd
anyway
I can do vulkan init now 
the hardest part has just been fighting this linter, not anything else
but I have it under control now
oh noes, the pointer star went to the right : |
it gotta go somewhere I guess
1024* 1024* 256
with C, if you want some memory, you gotta go hat in hand. you don't get it for free, putting the astrisk on the right is just the beginning if you want yourself some memory to put things in
texas style pointers
it's just a sign of gratitude, that, that you're thankful, for all the memory
(because the star is lone)
you gotta brand that memory, to show it's the right kind
right
it's that nice aligned memory, kept hot on the l1 and l2 cache, none of this page on disk memory that came down from the bus
it's super fresh
so the asterisks gotta go on the right i'm afraid
i hope you're right 
yeah clangd without a build system is a pain
but also, batch files are a build system, just a shit one
(when are you installing lunix btw)
i think we need a 2nd version of this, one with a little chimney, where smoke comes out, to visualize the jailee is cooking 😄
and also a variant of this sticker with demongod in it, with explosions in the background 
and the bike is a foldable mortar of sorts
but the bike is crossed out on some panel right behind it
When windows adds required code signing for executables and paid dev accounts like Apple
So probably never
Also then Id have to use clang also to compile and I would be even worse off
i cant parse the first half of the windows signing stuff
Try and ship a program that others can use on a mac
ah mac
i dont get it, just compile your program on a mac and sign it there then? what has windows to do with that?
I was asked when I would install linux, and my reply was when Microsoft adds the same requirements for sharing software that Apple has
Well you have to pay like a hundred dollars per year to apple
You can’t just self sign
I mean that would be one thing where I would definitely install linux that very day
I guess my UI will just be ASCII
Dwarf Fortress time.
that's my favorite game
Microsoft's C documentation is amazing https://learn.microsoft.com/en-us/cpp/c-language/?view=msvc-170
it's easy to find things, it's easy to read, it has examples, it's so good
it goes into tons of detail, covers alignment, macros, the C runtime
how the compiler works
I think that and the open standard pdf are enough
no cppref required
My eyes on that page. :')
but i wanna search and it's not doing anything 
but cppref has it all 
Yes, but if this site is good, then why does it not work. 😭
I rarely ever use MSDN directly, usually I get to it via another search engine. :)
Because their ehm, navigation is problematic.
also cppref is poluted with cpp details
there's a C section of cppref
That's fair, I'm usually looking for specific things when I check the references, so I don't click around much.
if you look at c stdlib functions on the c++ part, then you'll get c++ info
I'm sure there are other people who enjoy finding things via the MSDN site.
ah you know, it's the search leads me to C++ stuff first, it does have a C only section
nice
ah
ok another good resource
like the search for memset
it took me to C++ but then I looked further and saw there is a C result, but if I just browse the C section I can find what I want
see
evidence
searching for C is futile!
I've been using it for the past ~13 years and it's been a very nice experience
they even added links to source code of the .NET a couple of years ago
For example:
https://learn.microsoft.com/en-us/dotnet/api/system.span-1?view=net-8.0
under Definition there is Source: Span.cs
are you using DX12 for your project?
DX11/12/Vulkan, DX12 and Vulkan are still WIP
man memset 
a guy who tells you stuff
C:\Users\Bjorn\projects\code\palinode>man memset
'man' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Bjorn\projects\code\palinode>
:<
I was thinking about using DX12, since I am 100% windows only, but I cannot give up BDA :/
or slang
I have WSL2 so I can use that
hey
that's great
I forgot I had that
more resources, thanks! keep em coming lol
I'll just keep this wsl2 ubuntu tab open
grabs mirror and starts talking
a short video of my code flow, showing errors, auto completion, and then build and test, everything is so fast and light now
just no problems not using Visual Studio
only thing is, if the app crashes I have to use the Visual Studio debugger
to capture the crash
it doesn't seem like other debuggers can do that
I tried it with both rad debugger and remedybg
but I can just type devenv palinode.exe and it will startup Visual Studio which is just feels like it takes forever, but there's no otherway I think, but it will capture the crash and tell me where it happened, which is like a must
ok ok, I want to start getting through vk init so I can render stuff
you could start vs at the start already and just leave it in the background until you need it
start the debugger you mean?
just vs, so that you dont have to wait for it to start
oh
and then just attach the debugger when you need to later
you were complaining about long vs startup times
I mean
rad debugger is so fast it would take less time to launch rad debugger and hit f11 than it would to alt tab in to vs and do the same, and then rad debugger is just faster all around
idk
what I have determined is that rad debugger launches so fast, that it is actually faster to always quit rad debugger and just relaunch with my shortcut than it is to alt tab to rad debugger
yes and when you need to capture a crash, you can use the already started vs which lingers in the background, is what i mean
oh I see
yes
well hopefully I don't have any crashes
I am validating everything all over the place
aggressive validation:
internal VkResult query_instance_layers(AppContext *actx, Arena *arena) {
if (!arena) fatal("query_instance_layers: null arena");
if (!actx) fatal("query_instance_layers: null actx");
if (!actx->gctx) fatal("query_instance_layers: null gctx");
u32 property_count;
VK_CHECK(vkEnumerateInstanceLayerProperties(&property_count, NULL));
DEBUG_PRINT("num extension properties: %d\n", property_count);
VkLayerProperties *layers;
layers = arena_alloc(arena, sizeof(VkLayerProperties)*property_count);
if (layers == NULL) return VK_ERROR_INITIALIZATION_FAILED;
VK_CHECK(vkEnumerateInstanceLayerProperties(&property_count, layers));
actx->gctx->layers_count = 0;
for (int i = 0; i < (int)property_count; i++) {
VkLayerProperties layer = layers[i];
DEBUG_PRINT("Instance layer name: %s instance layer description: %s \n", layer.layerName, layer.description);
for (int j = 0; j < num_default_layers; j++) {
VK_STRCMP(default_layers[j], layer.layerName, {
actx->gctx->layers_count += 1;
break;
});
}
}
actx->gctx->layers = arena_alloc(actx->arena, sizeof(VkLayerProperties)*actx->gctx->layers_count);
if (!actx->gctx->layers) fatal("Failed to allocate gfx layers");
size_t current_layer = 0;
for (int i = 0; i < (int)property_count; i++) {
VkLayerProperties layer = layers[i];
for (int j = 0; j < num_default_layers; j++) {
VK_STRCMP(default_layers[j], layer.layerName, {
if (current_layer >= (size_t)actx->gctx->layers_count) fatal("layer overflow");
actx->gctx->layers[current_layer] = layer;
current_layer += 1;
break;
});
}
}
for (int i = 0; i < (int)actx->gctx->layers_count; i++) {
VkLayerProperties layer = actx->gctx->layers[i];
DEBUG_PRINT("Added instance layer: %s\n", layer.layerName);
}
return VK_SUCCESS;
}
no ub 🤞
this is my arena code so far:
Arena *init_arena(size_t min_size) {
Arena *arena = NULL;
arena = malloc(sizeof(Arena));
if (!arena) fatal("Failed to init arena");
size_t size = ALIGN_UP(CLAMP_MIN(min_size, ARENA_BLOCK_SIZE), ARENA_ALIGNMENT);
arena->start = malloc(size);
if (!arena->start) fatal("Failed to init arena data");
void* expected_ptr = ALIGN_DOWN_PTR(arena->start, ARENA_ALIGNMENT);
if (arena->start != expected_ptr) fatal("Allocated unaligned memory");
arena->ptr = arena->start;
arena->end = arena->ptr + size;
return arena;
}
void deinit_arena(Arena *arena) {
if (!arena) fatal("attempted to deinit a null arena");
if (arena->start != NULL) {
free(arena->start);
arena->start = NULL;
arena->ptr = NULL;
arena->end = NULL;
}
free(arena);
}
#pragma warning(push)
#pragma warning(disable : 5045)
void *arena_alloc(Arena *arena, size_t size) {
if (!arena) fatal("attempted to alloc from a null arena");
void *ptr = NULL;
ptr = arena->ptr;
size_t available = arena->end - arena->ptr;
// TODO: grow arena
if (available < size) fatal("Arena overflow, available: %zu", available);
// Align pointer
arena->ptr = ALIGN_UP_PTR(arena->ptr + size, ARENA_ALIGNMENT);
// Validate pointer alignment
if (arena->ptr > arena->end) fatal("Arena overflow after alignment, with available space: %zu", available);
void* expected_ptr = ALIGN_DOWN_PTR(arena->ptr, ARENA_ALIGNMENT);
if (arena->ptr != expected_ptr) fatal("Unexpected new pointer aignment");
return ptr;
}
#pragma warning(pop)
5045 are spectre warnings, I get a ton of them whenever I compare anything related to pointers
i know I mean which stuff, if u know already
my current todo list is (using just hard coded geometric shapes, no gltfs for now):
finish vk init
frame graph
instancing
animation
zoom/magnifier
MSAA
sky dome
env map
IBL!
Directional light
CSM Shadow
Point lights
Point shadows
AO
then I'll add textures and gltfs support I guess
is that a C89 thing there?
void *ptr = NULL;
ptr = arena-ptr;
``` rather than
```c
void *ptr = arena->ptr;
```?
I think it's the same after the compiler gets its hands on it
😄
I will start with obj tbh I love obj
I will do gltf later I am so over asset stuff
gltf sounds like a pain to nih ngl
yeah, fair enough
oh you said pain to
but the gltf spec is not very shrimple
yeah
it's not very convoluted either, tbf, but there's many levels of indirection
yeah
it's cool though to render nice 3D stuff with PBR materials
so I will eventually do it
I'll actually start with a PBR roughness metallic workflow from the get go even for my geometric shapes
make your own nih format 
I did that lol
that was my rsy asset format
is* I guess
I can alway go back to pick up where I left off if I ever wanted to
@broken fog do you have a project thread?
I thought I was following yours but I don't see it
what are you working on?
haven't had the time/motivation to work on it lately
uni and work lol
would love to get back to platinum soon, hopefully
work is webdev which i've grown to hate lol but it pays the bills for now, in uni i get to do fun stuff at times tho
i actually added a little software rasterizer to my assignment for computer arch class this semester
assignment was to build a kernel so totally unrelated lol, actually super fun on its own but i though why not add 3d graphics to the vga driver
anyway yea trying to speedrun uni and get some money on top leaves little time for projects and i kinda burned out on it earlier this year as well
oh that's cool
but will get back to it soon™ cause honestly it was super fun
well except when i spent like a month debugging my bsdf 
not the burnout part, the project is cool I mean
thanks heh
my job is pure misery

one of the reasons I actually stopped rosy was to be able to be able to be more present in real life and less rushing to always work on my "game"
and also to have something I could do on my laptop
all this expensive software can only be on my pc
sad, rosy was/is a very cool project as well
but hey, this new thing seems like it's gonna be a fun journey too
and by fun i mean probably a lot of type 3 fun
I hope so!
You're using C, you don't need to do anything lol
You'll have more loc then you'll know what to do with
Nice
As soon as you start getting into significant data structures, since it barely supports generic data structures so you'll have a lot of custom infrastructure per application
Even if you have a generic system that uses void* and a custom allocator (to avoid mallocing every node/whatever individually) you'll still have some extra glue to put in most likely
I am going to pattern my storage after Sean Barrel stb stuff
Stretchy buffer and the other stuff
Since I have an allocator I always know exactly how much heap I have allocated without any need for introspection which is cool
Nothing will ever be allocated without my code
or "templates at home" macro hell 
I'm not really into meta programming
I always take the 0.1x engineer more code approach
unless it becomes just too awful and a waste of time
I hate abstractions, a lot of engineers can't seem to wait to use latest thing, I'm not one of them, I like my imperative plain to read code. I went that way with Rosy, initially no helper functions, and then did a big, but actually easy, refactor that consolidated everything into really nice helper functions because by then I understood where they would be useful
that was really good I think starting with no helper functions, my rhi went from like nearly 10k lines of code to like 5k-6k
maybe u find this interesting https://caseymuratori.com/blog_0015
inshallah we shall purge the oop brainrot 🙏
I subscribe to Casey's substack
these 5 minutes I link to directly from his day 2 intro to C bascially explains why I am so excited about my current project https://youtu.be/KF29ePTqWa4?si=HaVRi33OxRCd42fI&t=4503
Day 2 of the introduction to C programming on Windows series from Handmade Hero. See http://handmadehero.org for details.
- Getting Visual Studio Community edition: http://www.visualstudio.com/
- Printing to the console with OutputDebugStringA ()
- Setting break points, intro to debugging
- Line breaks and the return character ‘\n’
- ...
the autosnapping is cool I want that in my UI
Like, literally, pretend you were a really great version of PKZip, running continuously on your code, looking for ways to make it (semantically) smaller.
And just to be clear, I mean semantically smaller, as in less duplicated or similar code, not physically smaller, as in less text, although the two often go hand-in-hand.
Like a good compressor, I don’t reuse anything until I have at least two instances of it occurring. Many programmers don’t understand how important this is, and try to write “reusable” code right off the bat, but that is probably one of the biggest mistakes you can make. My mantra is, “make your code usable before you try to make it reusable”.
that's a really good article
so one thing that I found valuable in my C++ though was I found private to be really useful for a particular exercise where I broke up my Editor.cpp into Editor.cpp and Level.cpp
and somewhere in a inbetween state Editor kept directly modifying level stuff because that's how it was originally when it was all the editor code
and eventually it just became such a huge problem that I just pulled the bits of data in Level.cpp that Editor was using and made them actually private
and that forced me to rewrite that code to be better
I could do that in C by using a forward declaration and defining something only in the C file I guess, but it was just a case where something being private forced me stop doing something bad, because enough was enough
I really had no idea what I was doing when I started on that editor code, so it was like an introduction to managing a bunch of assets different referencing to a bunch of things indirectly with colliding indices and I had to figure out how to make that work, and I had something that worked, but I still don't really feel great about the solution
throwing animation curves and key frames into the mix along with instances was like a bomb went off. I was so happy that I had instanced drawing done in like basically a day or two, and then I had 2 weeks of bugs to fix in the level editor as I realized more and more stuff had been broken
those were hard bugs too
(although as the cancerous C++ specification continues to metastasize, it’s starting to add more options for this, but that is a separate issue)
Spicy take: for a person who wants to make an indie game it would be really smart to:
- Use an existing engine
- Find some friends with a diverse set of talents to do it with, hopefully with more artists than engineers
- Make it a small and short game, only make it bigger once you see people are actually willing to pay money to play it
- Engineering is maybe the least important role on the team
- Players do not care if you made your own engine custom, if you used C++ or Rust, Vulkan or OpenGL. They just want to play a fun game.
all those people who told me on the Game Dev League server that I was silly to make my own engine were in fact correct
assuming your goal is to make a financially successful game
yes
I'm making a game I want to play, not necessarily one the market demands
I think the people who are far along with their game on this server are the rare talented enough people to pull it off
a lot of the successful indie games that we all know about all built a growing community of fans early in the development process, fans that loved the games and those games spread through word of mouth,
I followed Minecraft development very closely in 2011. I'd check notch's tumblr for updates every day in my robotics class lol
my first experience with minecraft was so much fun
https://github.com/romgrk/barbar.nvim looks cool
that's really nice
I don't necessarily agree, depends on the game genre
I had many unsuccessful attempts at making games using engines, frameworks and spartan style
one might argue that that's the reason I don't have a game and I'm wasting time and people that used those engines and released something have some insight on it
though for comparison purposes, how valid is sampling from a pool of people that only experienced one side of the coin?
if they didn't make a, even a simple game, without any engine but they released a game using an engine, do that make that sample a valid one? not necessarily
engine or not, making games are hard. engine stashes that complexity under the rug. but that will leak, always and it is nasty to deal with
and never in any of my projects, I had the luxury of "oh, I'll just do the game and ignore rest of the stuff", it never worked that way
you always have to fight against the tool, framework, engine, lack of source code or lack of easily amendable source code, bad documentation, decades of tech debt and cruft
that's a solid trade-off, you should know what you are buying and what you are getting as a result
for single person projects, most projects one person can actually pull off and finish off (no early access lingering for years to come) don't require that much technical build up if you already have experience with making games to some degree
I think this is an important narrative to come against because there are many people gaslighting theirselves or (worse) other people into engines as if they are the absolute way to do stuff
so I'd argue what a game requires is a fun, executable game idea with a good loop. if you have that, you can do it however you want as long as you have clear idea about the process and have chance at financial success
one could argue that this is bloat 😛
if u enjoy doing it, its not silly
who needs tablines, open buffer search works great
i dont think we are silly to make our own engines
its this kind of shit which interests us
everyone can make games, not everyone can make engines
😄 (big jk)
too late
as bjorn said, he might come back to this project 🙂
there is no escape from NIH
why bother using a game engine?™
exactly
Guys we need to have a really inflammatory reddit post this year
or we dont feed the trolls there
It was good for the views
And the trolls didn't comment on the video for the most part
just ask cybereality for some inflammatory reddit ideas 
I like it, I like being able to see current open buffers without having to do something without my fingers
why I gotta make my poor brain keep track of all that
or make these old hands have to type to know
without it, I'm constantly typing :ls and then I switch buffers
now I just see the list as tabs
yes, also most of my favorite games are like made solo devs
this is also very true
that games are hard
Whatever you do, the bikeshed will come and find you
me: man, making games is hard
also me: let me build renderer in C
although
void * is very nice, yes
everything is now void *
jk
I realized yesterday that I never did vk debug messages correctly in my previous projects, pMessages are UTF 8 strings
I never handled that
list of open buffers in telescope tho
do the hard thing, declare feature freeze for two weeks
fair enough, that's pretty nice
might give it a shot
how does it handle multiple panels
do you get one tabline per panel?
cause most tabline plugins are kinda ass with multiple views and that's why i don't use em much
void* my beloved
no, just one tab bar, it's just the list of open buffers you get with :ls so it's the same for all the panes
oh
I love rad debugger tbh, so clean
^^ my VK_CHECK macro was wrong, it ran a failed thing multiple times and I figured it out from that
why don't you use a function for that
-#define VK_CHECK(res) \
+#define VK_CHECK(x) \
do { \
+ VkResult res = (x); \
if (res != VK_SUCCESS) { \
macro moment 😩
I just don't see the advantage of using a macro for this
but everyone uses one for some reason
yeah idk
macros is the reason why i dont want to write c
@alpine basin talked me into using vcc for my shader in this project, so if I don't have pixels for a bit it's all their fault
uwu
also starting with mesh shaders too :P
:0
if you face any problems, then we have gobi right at our finger tips to fix shit 🙂
yeah I mean it's all fun and learning, it's not a game™
it's basically a renderer right?
of course, its all fun here
yes to both
use bindless
idk honestly, I'm just going to look to see if it's less work
if it's more work then I won't do it
rosy is still on vk 1.3 and was looking at v 1.4 features
Current progress
[x] vkGetInstanceProcAddr;
[x] query_instance_layers();
[x] query_instance_extensions();
[x] init_instance();
[x] create_debug_callback();
[x] init_surface();
[x] init_physical_device();
[x] query_device_layers();
[x] query_device_extensions();
[x] init_device();
[ ] init_allocator();
[ ] init_presentation_queue();
[ ] init_swapchain();
[ ] init_draw_image();
[ ] init_descriptors();
[ ] init_command_pool();
[ ] init_command_buffers();
[ ] init_sync_objects();
[ ] init_commands();
[ ] init_shaders();
[ ] init_data();
[ ] init_default_sampler();
missing one checkbox
[ ] the_game();
If I did make a game it would be like snake or tic tac toe or something
I think you said you just wanted to make a renderer which is a fine goal imo
Yeah
Not making a game
Just if I was
My ambitions have plummeted to the floor on that
I think I'm just going to render to the swapchain image at first
and then follow up with figuring out how to allocate memory for images after I have some pixels
I'm going to use a host allocator too
I want to allocate all of the memory my process uses
on the host and gpu
oh I wonder if vcc supports mesh shaders
Entry points #
Shader entry points need to be annotated with one of:fragment_shader
vertex_shader
compute_shader
Also requires setting local_size(x, y, z)
nope
that's fine
oh
the video says can be used for any vulkan shder stage
that's a good talk
I'll try it
oh maybe I use vcc instead of msvc for the application 🤔
really cool stuff
My first pass at allocator just so I can have a draw, depth and msaa image is just keep it simple and just over allocate and blow up if it ooms, but already have ideas for a more complex allocator that handles fragmentation and has good reallocation
I know I can just look it up, just want to try my ideas
[x] vkGetInstanceProcAddr;
[x] query_instance_layers();
[x] query_instance_extensions();
[x] init_instance();
[x] create_debug_callback();
[x] init_surface();
[x] init_physical_device();
[x] query_device_layers();
[x] query_device_extensions();
[x] init_device();
[ ] init_allocator();
[x] init_presentation_queue();
[x] init_swapchain();
[ ] init_draw_image();
[ ] init_descriptors();
[ ] init_command_pool();
[ ] init_command_buffers();
[ ] init_sync_objects();
[ ] init_commands();
[ ] init_shaders();
[ ] init_data();
[ ] init_default_sampler();
tons of work left still
Almost got to a clear color before I got too tired
I always learn something new when I go through vk init
I will be making my own math library in C which I will also be able to use in my shader
I am on board with the vcc thing
A new level
I am thinking about using C to write C
That would help with the math and vk loading
Had to work super late today 
Me every day because I go to work late and then have to work late to get my hours in
It sucks I need to stop doing it
I now have one pixel
gonna work on resize tomorrow, maybe a small animation, and then start on a vcc shader and see if I can get a triangle or something
if work permits
my next vulkan renderer after this one I will write in object oriented PHP
where there is one there are many
This is rosy waiting for me when i had to work late last night
my window is super dirty, need to clean it lol
please knuddle rosy for me 🙂
win32 is ezpz
I guess vcc triangle is next
I wasted so much time on SDL in the past when I never did a single thing that ever ran on non-windows, could have just been using the win32 all this time and no need for a gitsubmodule, dll nonsense
just following the how to instructions like a sheep
I am quarantining my win32 code though in case I ever did want cross platform, which I think is a better solution than just jumping right into SDL or glfw.
glfw is a lot less worse than SDL though
in terms of overall dependency burden
idk wasn't a huge deal, but I dont' have to worry about it
if I want Palinode to run on mac/linux I'm just going to write that code myself also
look at that bright green strip since I started on the C renderer, it dimmed the rest of the year
damn i wish my git history looked anything like that lol
this year it's been pretty fuckin barren
Yeah I work on open source projects hosted on GH for my job
lol
In fact I made all my personal projects private when I had my extreme anti social moment earlier this year and have kept them private
But you can still see my private contributions there
anyone know of an offline tool that generates that graph? I've been looking for one for ages
the closest I got to having one was when I had a gitea instance but I retired it ages ago
You are using git right?
yes but not on github, and bitbucket doesn't show such graphs out of the box
Yeah I'm also not using GH.
Would be interested
but tbh, the graph is not neccesarily a good reflection of work done
especially on personal projects
Its more of a reflection of how diligent you are at breaking tasks up into tiny commitable chunks
think it's more about streaks than how many commits you have per day
Yeah but I often go 2-3 days without making a commit
But I'm still working
I just make one giant one after that time
My public GH is a disaster
that's kinda worrying to me I averaged something like 2 commits per day these past 3 years tho this includes a half year hiatus
I need my small commits to feel like nothing's going to go wrong XD
I was curious about the graph because I legit don't remember ever taking a single break this past 1 year to 1.5 yrs and I wondered what the streak would look like XD
I make many small commits
I cannot deal with large diffs
My brain is too small for it
If it builds I commit
For work stuff where someone is reviewing PRs, yeah large diffs suck. But for my personal stuff, I just get bogged down with the overhead of git stuff
I use PRs on my own project
You review them yourself?
For the overall goal of what I am working on
bjorn if you keep self deprecating yourself or whatever the term is at each and every single step you'll eventually join deccer in the lame tombstone club
there are far more practical reasons for small commits than "my brain is too small for it"
AI reviews it and I go over it too. I don’t use AI in my editor but I do value AI reviews
And I like seeing a PR to refer back to
To understand why I made a change
copilot has been doing real good at work, it's so amazing at generating and reviewing corporate code slop XD
Isn't that what the commit message is for?
all the shit I'd have to write otherwise, copilot is like "no no allow me"
Not for me
Also easy to git bisect to fix bugs
anti-AI sentiments will not age well imo. I don’t use AI for my personal code because I am having fun but my code at work goes BRR
anyway credit where credit is due, I shipped something that worked and had unusually many features, made a legacy class be testable and added a test suite to the project for it, all in one morning and wouldn't have happened without copilot (w/ claude sonnet) generating most of the boilerplate
I was of course gaslit into thinking there was a real deadline today, there wasn't but that's another story
I didn't start out being anti-AI. The industry drove me to it
the point is before AI I would've said "yeah this will take at least two or three days"
The reviews also frequently find real issues
the thing was even able to "understand" the underlying business logic when generating the tests, they weren't like, shallow or random
That would have taken me a lot of misery and time to debug
There’s no way I am turning it off ever
but my favorite part was the fact that I was able to provide detailed logging because it kept generating good and accurate Console.WriteLine's for every single case 
wish I could use it at home but I hate products with pay-per-usage that can balloon in costs
I do not have these issues. I use Claude Code and my daily token spend is like sometimes $30 to $50 a day
fifty fucking dollars a day
They made copilot usable for free to a certain extent
I actually used it for a few months
but then I turned all that shit off
I am not using a restricted model with a $20 monthly plan
bjorn youre wasting your money hire someone to make your projects instead
yeah cut out the middleman and just hire the 3rd worlders that power the mechanical turk directly
Idk my code works, the customer is happy, my employers and coworkers are happy, you can see my code it’s all open source
Hire firefly
yeah hire me and I'll have claude generate the code 
I'm also against it for rule 8 reasons which I won't go into
as a side note I hate the proliferation of the term vibe coding
me too
that said if you're getting paid for the code you're generating, then $50 is a steal
when I said I wouldn't pay for it I mean for dusk
yeah it's definitely a steal until the value gap closes
because if I had $50 to spend per day for dusk
I'd spend them on food and I wouldn't be having a job
I'd be working full time on it
when put into that perspective, $50 is an immense amount of money
I am not paying it, it’s company money
is $18k/yr about median in the philippines or is it high
philippines? 
I thought you were in the philippines, am I misremembering
nope I'm in romania, it's the country with the highest inflation in the EU and crazy prices relative to income
and $50 a day would still get me three VERY big meals
oh that's... close
it's just such an insane amount of money I just can't
I though hungary was worse?
I don't think they have been for a while, but they're not far
eastern europe shithole competition
Romanians like to dunk on Hungary right?
hmmm we don't dunk on our neighbors that much tbh but I guess there is some enmity there given our history
Cost of living in the sf bay area is ridiculous
like how russia thinks about ukraine, some hungarians think about transylvania the same
Oh we dunk on our neighbours all the time here. But I think they can handle it lmao
Berkeley minimum wage is $19.58 per hour and it is not a livable amount of money
there's always been a trend here, for people near the border with hungary to go do groceries and get gas in hungary, because it's cheaper
The cost of living is very high here
those near the border with bulgaria do the same
You can’t pay for housing, much less food with minimum wage.
nobody comes to buy here because we're too expensive XD
We deserve it though
Idk which neighbor you mean
CA definitely does
how many neighbors does canada even have
does greenland count?
I guess russia across the north pole yeah
Yeah
AI as a linter strikes me as potentially useful just because it's basically out of the development loop and simply tags things for closer inspection that you might not have looked at closely yourself, could catch security issues or something I guess
Then it can simply be ignored if you aren't interested in using AI tools
Unlike those horrendous "AI-first" policies where companies mandate that code is written with AI
?
Technically we have two now but yes I did mean you guys lmao
We have a land border with Denmark & USA
I might be in vancouver in 2026
software you can love is planning on a conference in 2026 but they haven't announced it yet
I don't write zig anymore but I still like the community
It's a zig conference?
not really
more like a systems programming conference
the last one hardly had any zig talks
but it is mostly zig people who go because it is strongly attached to the zig core dev team
it's similar to handmade
I would totally hire Firefly btw
I'm not a manager anymore so I don't make hiring decisions or know what the head count is but https://www.conductorone.com/careers/ and https://www.conductorone.com/docs/baton/faq/ <-- is what I build it is very boring stuff
sometimes I abandon stuff before I start committing as I don't like starting to commit immediately when I start out and have a lot of momentum
after I replied to Bjorn several days ago, I had a self reflection on my failures and decided to go with godot and suck it up btw. I am still terminal NIH though, it is just a tactical retreat for the moment. will probably use godot as frontend after most of the gameplay becomes solid. in any case, thanks Bjorn
godot seems really capable and awesome
if I want to build a game, an actual game, I would use an engine
I know that's heresy
it's still a lot of work to make a game even with an engine
players don't care how the game was made
I just realized I forgot to handle minimize
I was going to work on triangle, but I need to make sure I don't crash on minimize when I get home from work
I'm starting with instance drawing an animation from the very get go
shoehorning it in afterwards was painful with Rosy
like the assumption that there was only one thing and it was static, that was all over the code in surprising places
one thing of each type
Yeah, player mostly just cares:
- game runs well
- game looks good (optional in some cases)
- game feels good (even if buggy, plus bugs can be beneficial to the game sometimes)
I think this is the best way to use LLMs for coding
Linus said they are basically an advanced linter and I agree
I just asked Claude to check out an older release of a repo I'm working on and determine how a deprecated config flag works
it's going through all the code and doing that while I do something else
I can also set authorization tokens for services like AWS whatever for sandbox environments and ask it to generate client models and http request code for some API by giving it the api doc link
it'll make requests, test the apis, and write all the code for that
it's not just an advanced linter
it does all this while I am doing other things
I review the code and test it myself
to be AI adverse, to constrain it, to think it's just categorically bad because AI is being used bad in some places, it's just a mistake
and incorrect
I am not a braindead ai proponent, I actually think it's destructive and largely bad
but it makes my job easier, the tech works as advertised
I can run multiple instances of claude while it does this for different connectors I have in progress
it's ridiculous
there's no way i'm going to say no I'm not using this
and if I did, I'd get fired
Claude Output:
⏺ Key Differences Between v0.0.9 and Main
v0.0.9 Implementation:
- Had configurable sync-grant-sources flag (default: false)
- Applied GrantExpandable conditionally only when flag was enabled
- Used in pkg/connector/helper.go:146-155 for ACL processing
- Added expansion for team/group member AND admin roles
Current Main Implementation:
- No configuration flag - grant sources are always synced
- GrantExpandable is now always applied in two places:
a. groups.go:103-110 - When group members are other groups
b. projects.go:90-96 - For project access grants to groups
What's the same:
- Both use GrantExpandable annotation with EntitlementIds
- Both target group membership expansion
- Both use Shallow: true for some cases
What's different:
- Scope: v0.0.9 was broader (ACL-based), main is more targeted (group membership only)
- Configuration: v0.0.9 was optional, main is always on
- Implementation: v0.0.9 used ACL processing, main uses direct group membership APIs
- Expansion types: v0.0.9 included admin roles, main focuses on member relationships
So yes, you're essentially doing the same thing for group members now, but it's always enabled and more focused on direct group
membership relationships rather than the broader ACL-based approach in v0.0.9.
that saved me so much fucking time
it's also correct
I'm gonna go back to talk about Palinode instead of work though 😅
yeah that sounds like a blessing
it is
indeed, unless someone is teenager, most people end up with NIH due to control fetish
and tool you use affects the way you do stuff. you can obviously fix all tool related issues, people are doing it all the time
eh, I end up with NIH because the only game engine I actually like working with doesn't have the features I need for the games I want to make 
I have NIH due to a phobia of using unreal
one example that annoys me with godot + gdscript for example that you lack custom value types
as a result I code around it and design stuff around it. and will probably offload heavy work to rust with gdextension at some point
like it gives me all the control I really need for the game it's just
I don't want to lay out like a million trees by hand and setting up density regions using objects is a pain, lol
Lyz you use godot yes?
I remember you were sharing something like that
I think this server should be friendly to graphics programming using engines
I'm not sure
it's still graphics programming?
yes
It is if you're programming graphics
There's nothing in the rules against using pre-existing engines
It's true we have a culture of NIH but we've had quite a few people come through here while using existing engines
yes but consider
number go up
Frankly I had not considered this, you are in fact correct
the graph for me represents more my daily commitment, and not the total amount of work done. I get one commit in every day, and sometimes I just have a small commit
it's like a habit tracker
the hue of the color does tell me something about what that day was like for me
the days on which I have no work were either very good days or very bad days
If you’re doing graphics stuff, yes
… unfortunately tree placement is not really graphics
The ideal way for me to do that would probably be to make my own extension, which is something I don’t really want to learn
Terrain 3d extension might have what I need by this point but idk; last I checked on it I don’t think supported foliage colliders, which are kinda important for trees
Ah
holy shit, my app doesn't crash when I minimized it, and I didn't have to do anything extra
hrm I do see a VVL though
I remember having to write code to handle minimized to not render during that moment
with SDL
which I should do anyway even here, but the app didn't crash
vichichi as deccy calls it
fancy
that should be it for win32 apis I need to deal with, just have to handle keyboard and mouse events
don't plan to add any audio or anything
Vcc supports advanced C/C++ features usually left out of shading languages such as HLSL or GLSL, in particular raising the bar when it comes to pointer support and control-flow:
Unrestricted pointers
Arithmetic is legal, they can be bitcasted to and from integers
Generic pointers
Generic pointers do not have an address space in their type, rather they carry the address space as a tag in the upper bits.
True function calls
Including recursion, a stack is implemented to handle this in the general case
Function pointers
Lets you write code in a functional style on the GPU without limitations
Arbitrary goto statements - code does not need to be strictly structured !
nice
Non header-only libraries, including parts of the C and C++ standard libraries, will not work on the GPU without additional work, because of the way Vcc works.
no malloc/free, that's fine
Function and data pointers are not portable between host and device. Taking addresses and passing them across in either direction is UB - since Vulkan lacks a unified addressing extension this is a limitation we cannot address at this time.
hrm
so I'm going to write my own math library and use it for both the shader and for application and see how that plays out
I think that is doable given the constraints here
hrm
:\Users\Bjorn\projects\code\shady\build>dir bin\Release
Volume in drive C is OS
Volume Serial Number is 5C1A-ED43
Directory of C:\Users\Bjorn\projects\code\shady\build\bin\Release
07/11/2025 08:04 PM <DIR> .
07/11/2025 08:04 PM <DIR> ..
07/11/2025 08:04 PM 721,920 aobench_host.exe
07/11/2025 08:04 PM 717,312 checkerboard.exe
07/11/2025 08:04 PM 52,219,456 LLVM-C.dll
07/11/2025 08:04 PM 507,392 opt_oracle.exe
07/11/2025 08:04 PM 720,896 runner_test.exe
07/11/2025 08:04 PM 736,768 slim.exe
07/11/2025 08:04 PM 239,104 test_builder.exe
07/11/2025 08:04 PM 15,360 test_dict.exe
07/11/2025 08:04 PM 227,328 test_math.exe
07/11/2025 08:04 PM 15,872 test_util.exe
07/11/2025 08:04 PM 716,288 vcc.exe
11 File(s) 56,837,696 bytes
2 Dir(s) 379,791,679,488 bytes free
C:\Users\Bjorn\projects\code\shady\build\bin\Release>slim.exe --help
--log-level debug[v[v]], info, warn, error]
--shd_print-internal Includes internal functions in the debug output
--shd_print-generated Includes generated functions in the debug output
--no-dynamic-scheduling Disable the built-in dynamic scheduler, restricts code to only leaf functions
--lift-join-points Forcefully lambda-lifts all join points. Can help with reconvergence issues.
--execution-model <em> Selects an entry point for the program to be specialized on.
Possible values: Compute, Fragment, Vertex, RayGeneration, Callable,
--target <c, glsl, ispc, spirv>
--output <filename>, -o <filename>
--dump-cfg <filename> Dumps the control flow graph of the final IR
--dump-loop-tree <filename>
--dump-ir <filename> Dumps the final IR
No target specified, defaulting to a generic one.
--entry-point <foo> Selects an entry point for the program to be specialized on.
--word-size <8|16|32|64> Sets the word size for physical memory emulation (default=32)
--pointer-size <8|16|32|64> Sets the pointer size for physical pointers (default=64)
--subgroup-size N Sets the subgroup size the program will be specialized for.
--use-native-tailcalls Sets the subgroup size the program will be specialized for.
--use-native-fncalls Sets the subgroup size the program will be specialized for.
unknown filename extension '--help', interpreting as Slim sourcecode by default.Failed to read file '--help'
hrm
C:\Users\Bjorn\projects\code\shady\build\bin\Release>vcc.exe --help
--log-level debug[v[v]], info, warn, error]
--shd_print-internal Includes internal functions in the debug output
--shd_print-generated Includes generated functions in the debug output
--no-dynamic-scheduling Disable the built-in dynamic scheduler, restricts code to only leaf functions
--lift-join-points Forcefully lambda-lifts all join points. Can help with reconvergence issues.
--execution-model <em> Selects an entry point for the program to be specialized on.
Possible values: Compute, Fragment, Vertex, RayGeneration, Callable,
--target <c, glsl, ispc, spirv>
--output <filename>, -o <filename>
--dump-cfg <filename> Dumps the control flow graph of the final IR
--dump-loop-tree <filename>
--dump-ir <filename> Dumps the final IR
--entry-point <foo> Selects an entry point for the program to be specialized on.
--word-size <8|16|32|64> Sets the word size for physical memory emulation (default=32)
--pointer-size <8|16|32|64> Sets the pointer size for physical pointers (default=64)
--subgroup-size N Sets the subgroup size the program will be specialized for.
--use-native-tailcalls Sets the subgroup size the program will be specialized for.
--use-native-fncalls Sets the subgroup size the program will be specialized for.
Missing input file. See --help for proper usage
these seem like the same program
it works
as in vcc works, I'm not rendering anything yet
#include <shady.h>
descriptor_set(0) descriptor_binding(1) uniform_constant sampler2D texSampler;
location(0) input native_vec3 fragColor;
location(1) input native_vec2 fragTexCoord;
location(0) output native_vec4 outColor;
fragment_shader void main() {
native_vec4 tint = (native_vec4) { fragColor.x * 0.8f, fragColor.y * 0.8f, fragColor.z * 0.8f, 1.0f };
outColor = texture2D(texSampler, fragTexCoord) * tint;
}
C:\Users\Bjorn\projects\code\palinode>vcc -I"C:\Users\Bjorn\projects\code\shady\build\share\vcc\include" vcc\shader.c
clang version 19.1.1
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin
file=vcc\shader.c tmpfile=vaGDatonjiMM9B7F2yys0c1A6ZuTPKNC
built command: clang -c -emit-llvm -S -g -O0 -ffreestanding -Wno-main-return-type -isystem"C:\Users\Bjorn\projects\code\shady\build\bin\Release/../share/vcc/include/" -D__SHADY__=1 --target=spir64-unknown-unknown -Xclang -fpreserve-vec3-type -o vaGDatonjiMM9B7F2yys0c1A6ZuTPKNC "vcc\shader.c" "-IC:\Users\Bjorn\projects\code\shady\build\share\vcc\include"
Clang returned 0 and replied:
LLVM IR parsed successfully
Done
C:\Users\Bjorn\projects\code\palinode>spirv-val.exe vcc\output\shader.spv
C:\Users\Bjorn\projects\code\palinode>spirv-dis.exe vcc\output\shader.spv -o vcc\output\shader.spvasm
C:\Users\Bjorn\projects\code\palinode>spirv-cross.exe vcc\output\shader.spv --output vcc\output\shader_clean.glsl
that produced a valid spirv and this glsl via spirv-cross
#version 450
#if defined(GL_ARB_gpu_shader_int64)
#extension GL_ARB_gpu_shader_int64 : require
#elif defined(GL_NV_gpu_shader5)
#extension GL_NV_gpu_shader5 : require
#else
#error No extension available for 64-bit integers.
#endif
#if defined(GL_KHR_shader_subgroup_basic)
#extension GL_KHR_shader_subgroup_basic : require
#elif defined(GL_NV_shader_thread_group)
#extension GL_NV_shader_thread_group : require
#elif defined(GL_ARB_shader_ballot) && defined(GL_ARB_shader_int64)
#extension GL_ARB_shader_int64 : enable
#extension GL_ARB_shader_ballot : require
#else
#error No extensions available to emulate requested subgroup feature.
#endif
vec4 _57;
struct _100
{
uint _m0;
uint64_t _m1;
};
struct TreeNode
{
uint64_t _m0;
uint _m1;
};
struct _229
{
uint _m0;
uint _m1;
};
struct _266
{
uint _m0;
bool _m1;
};
struct _370
{
uint _m0;
TreeNode _m1;
};
struct JoinPoint
{
TreeNode _m0;
uint64_t _m1;
uint _m2;
};
struct _478
{
uint _m0;
JoinPoint _m1;
};
layout(binding = 1) uniform sampler2D texSampler;
layout(location = 1) in vec2 fragTexCoord;
layout(location = 0) in vec3 fragColor;
layout(location = 0) out vec4 outColor;
shared TreeNode scheduler_vector[1][64];
shared TreeNode active_branch[1];
shared uint actual_subgroup_size[1];
shared uint64_t resume_at[1][64];
shared uint scheduler_cursor[1];
shared uint64_t next_fn[1];
#if defined(GL_KHR_shader_subgroup_basic)
#elif defined(GL_NV_shader_thread_group)
#define gl_SubgroupInvocationID gl_ThreadInWarpNV
#elif defined(GL_ARB_shader_ballot)
#define gl_SubgroupInvocationID gl_SubGroupInvocationARB
#endif
uint generated_init(vec4 outColor_physical, out uint _RESERVED_IDENTIFIER_FIXUP_68_physical, out vec3 fragColor_physical, out vec2 fragTexCoord_physical, vec4 _RESERVED_IDENTIFIER_FIXUP_837_physical, uint stack_ptr)
{
_RESERVED_IDENTIFIER_FIXUP_68_physical = gl_SubgroupInvocationID;
fragTexCoord_physical = fragTexCoord;
fragColor_physical = fragColor;
return stack_ptr;
}
uint main(out vec4 outColor_physical, uint _RESERVED_IDENTIFIER_FIXUP_68_physical, vec3 fragColor_physical, vec2 fragTexCoord_physical, vec4 _RESERVED_IDENTIFIER_FIXUP_837_physical, uint stack_ptr)
{
vec4 _61;
_61.x = fragColor_physical.x * 0.800000011920928955078125;
_61.y = fragColor_physical.y * 0.800000011920928955078125;
_61.z = fragColor_physical.z * 0.800000011920928955078125;
_61.w = 1.0;
outColor_physical = texture(texSampler, fragTexCoord_physical) * _61;
return stack_ptr;
}
uint generated_fini(vec4 outColor_physical, uint _RESERVED_IDENTIFIER_FIXUP_68_physical, vec3 fragColor_physical, vec2 fragTexCoord_physical, vec4 _RESERVED_IDENTIFIER_FIXUP_837_physical, uint stack_ptr)
{
outColor = outColor_physical;
gl_Position = _RESERVED_IDENTIFIER_FIXUP_837_physical;
return stack_ptr;
}
void main()
{
vec4 outColor_physical;
uint _RESERVED_IDENTIFIER_FIXUP_68_physical;
vec3 fragColor_physical;
vec2 fragTexCoord_physical;
vec4 _RESERVED_IDENTIFIER_FIXUP_837_physical;
uint stack_ptr = generated_init(outColor_physical, _RESERVED_IDENTIFIER_FIXUP_68_physical, fragColor_physical, fragTexCoord_physical, _RESERVED_IDENTIFIER_FIXUP_837_physical, 0u);
uint stack_ptr_1 = main(outColor_physical, _RESERVED_IDENTIFIER_FIXUP_68_physical, fragColor_physical, fragTexCoord_physical, _RESERVED_IDENTIFIER_FIXUP_837_physical, stack_ptr);
uint stack_ptr_2 = generated_fini(outColor_physical, _RESERVED_IDENTIFIER_FIXUP_68_physical, fragColor_physical, fragTexCoord_physical, _RESERVED_IDENTIFIER_FIXUP_837_physical, stack_ptr_1);
}
neat
cool af
time for that triangle
I can see the spirv too via vcc\output\shader.spvasm
disassembly I mean
When cross-compiling, certain identifiers are considered to be reserved by the implementation. Code generated by SPIRV-Cross cannot emit these identifiers as they are reserved and used for various internal purposes, and such variables will typically show up as RESERVED_IDENTIFIER_FIXUP or some similar name to make it more obvious that an identifier has been renamed.
idk what that was, so looked it up
i'm gonna go exercise then work on a triangle, I don't have a dynamic render pipeline yet or anything, nor anything other than a clear color and a present
NeoVim is amazing — until it breaks.
With each additional plugin, the incremental benefit to productivity and usability declines. These diminishing returns inspired me to create a minimal, pluginless NeoVim config for those times when that is all you need. This tutorial is applicable to both those getting started with NeoVim as well as those ...
discord sold their data to youtube again
I wouldn't be surprised, probably one of the few apps that can actually secretly listen to all the things it could "advertise" to me.
Of course it would still not know what the hell I want because I mispronounce brand names for laughs.
hehe
I just assume there’s no privacy on the internet. Everything I type, do or look at is happening in a public square anyone can see.
It's just disappointing
I don’t care personally. I internalized it all long ago.
I am working through Casey Muratori’s Computer Enhance course and writing my own math C library that runs both on the cpu and the gpu will maybe be a fun way to practice what I am learning in the course.
I am going to try and get good at understanding SPIR-V disassembly in the same way I am learning about disassembly on the cpu
I spent a bit of time, and I'm not using textures right now anyway, but I don't see any evidence that vcc supports bindless textures, and am not sure how to use the nonuniformEXT or declare a pointer of sampler2D or even an array of sampler2D
hrm
plumbed some of the depths of the emit spirv code
and how the annotate code worked
I'll just experiment a bit with just non-texture stuff and then probably go to slang, I don't want to bother anyone about it with questions
I'm a ways away from using textures anyway
maybe I risk asking a question when I get to that point that I want to use a texture
and after spending some more time looking through the compiler code
you can't make a pointer of samplers (how would you get the pointer?) but I don't see why vcc wouldn't support an array of them
hmm you'd have to ask gob about it
yeah I don't want to ask until I am sufficiently worthy, which may be an unatainable goal
in shady.h I see
typedef __attribute__((address_space(0x1001))) struct __shady_builtin_sampler2D* sampler2D;
I think the builtins are generated from spirv grammar maybe
lame
You are worthy
don't feel afraid to ask
I bet they are hardcoded tbh
I have searched the full codebase
I looked through the memory addressing stuff and the emit code
the only reference to sampler2D is in the example and that works with the compiler
man your question would've taken 20 seconds for gob to answer
I built the compiler from this source code
I bet
:P
anyway I need to actually write some code to be able to draw even a triangle
having issues with creating the shader objects in vulkan with vcc
I'm going to file a bug
this here is a comparison of slang and vcc spirv output if anyone is interested https://gist.github.com/btipling/1e4ec7f8c55494eb8302a448e13215a6
for similar fragment shaders
that's the wrong output actually
I fixed it, that was the vert output
made an issue https://github.com/shady-gang/shady/issues/48
I had another copy paste fail, I had the wrong code in that frag.slang in that gist that's fixed too now
so the Slang support for neovim is pretty good, for visual studio it felt very broken in comparison
I'm gonna use an nvidia only extension :/
VkPhysicalDevicePerStageDescriptorSetFeaturesNV
so I can use dynamicPipelineLayout
hrm
I think that breaks renderdoc
hrmmmm
lemme see if it has that, since nintendo switch probably uses this
oh
renderdoc doesn't even support vulkan 1.4
RIP renderdoc
Nsight Graphics™ 2025.2 frame debugging supports all of Vulkan 1.4.310.0.
VK_NV_per_stage_descriptor_set supported
it's not supported
it's in the not supported list
fine I can't use it then
I'll use 1.3 also
k
gross
??
oh
A

where did I get that if statement from
now, unfortunately, I need to set up the bindless descriptor sets, so I can send push constants to this thing
and after that I'll have to write a bunch of allocators
so I can allocate memory on the GPU
then I can have buffers and geometry and images
and I'll be able to do msaa and have a draw image
this went way quicker than it did with either of my C++ VK renderers
noice
T
a
l
l
T
r
i
a
n
g
l
e
It can’t know how to scale until I do a bunch of work
I need to implement descriptors and start a math.c and then I could send an orthographic projection with push constraints
If I want to pull from gpu memory I need to start on the memory allocator
I learned a lot about debugging windows applications yesterday
I installed procmon, wingbd, and a bunch of other tools to debug what caused renderdoc to fail to launch my app
I figured it out and that works now
Those tools are great
Nsight is still failing to launch
the vk project 1 week to tringle meme is real
I also learned that there’s nvidia gou crash app helper
Well, in my defense I am doing a bunch of new things this time and had to work late three days
But if this were C++ and I was using vk bootstrap and VMA and slang from the start it would take me less than a day
But it would not be as much fun
Everyone starting out should probably just take Sascha’s new tutorial and use that
You have to go through it and at the end you have a good starting point, it’s a good tutorial
The slowest thing about it would be how long it takes a Vulkan document page to load it takes like 10 seconds
They should just have no js html pages
vkspec.pdf + sumatrapdf if you're on windows or a any good reader elsewhere
Oh I will check sumatrapdf out thank you
i can read the vk spec on even a potato pc with it
peak windows software, same aura as notepad++ or paint.net
Yes I like notepad++ I am trying to get back into neovim for editing , but I find it easier to open up all my references projects in notepad++. That is a bunch of C projects to look how they to do things with C. I used it to search through shady code
@dark saffron I am fully onboard now with the using real languages for shaders. Thank you for building vcc, I think it is great and would like to get it to work, going back to slang was just to make sure I could make progress, it feels like a big step back through. I was planning on writing shared code. I am going to spend more time on what I'm running into with vcc
I will get nsight to launch my application, maybe whatever is causing that issue is something that is a sign of some larger problem
I really want to write shaders in C
Thanks! I saw your issue I'm addressing some other bugs but I'll get on it asap
thanks! if you need any information from me I will keep monitoring the issue, I have to read my github inbox for work so I am always looking at it
ok I got both nsight and renderdoc working now I have some layer messages to go through from nsight though
ID,,Origin,Source,Message
20,,Target,NVIDIA Nsight Graphics,Detected VK_LAYER_KHRONOS_validation without VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT; this will disabled all NVIDIA hardware specific features (e.g. profiling)
sumatrapdf is very nice
my preferred pdf viewer is mupdf, I should try sumatrapdf though
it opens the vk spec with no issues
I have been using just my browser to read pdfs
and it's so much better than a browser
same but that has given me issues with super image heavy pdfs
yeah this and the spirv spec are rough in my browser
sumatrapdf looks better than mupdf for proper reading tbh, mupdf is like the mpv of pdf readers
as in it'll just give you the pages and nothing else
I can't believe I haven't heard of this reader before
same, I actually only found mupdf because I saw one of its maintainers comment on a harfbuzz issue
never had an internal msvc compiler error before
C:\Users\Bjorn\projects\code\palinode\build>cl /TC /nologo /std:clatest /Wall /Zi ..\src\main.c /Fe:palinode.exe /I ..\include /I C:\VulkanSDK\1.4.313.2\Include /link /LIBPATH:C:\VulkanSDK\1.4.313.2\Lib vulkan-1.lib User32.lib
main.c
C:\Users\Bjorn\projects\code\palinode\src\gfx.c(775): warning C4034: sizeof returns 0
C:\Users\Bjorn\projects\code\palinode\src\gfx.c(657) : fatal error C1001: Internal compiler error.
(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\Utc\src\p2\main.cpp', line 258)
To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
cl!InvokeCompilerPassW()+0x5971b
cl!InvokeCompilerPassW()+0x5971b
cl!InvokeCompilerPassW()+0x596e8
cl!InvokeCompilerPassW()+0x595f3
cl!InvokeCompilerPassW()+0x591b5
I'm finding all the edge cases this weekend
Sumatra gives you little more than that as well tbh
its my preferred pdf reader on binbows too
I'm going to periodically do a YT video as part of a series where I give myself 1 hour to build a win32 software rasterizer from scratch in C and see how far I get. Not like a daily thing, just whenever I feel like it
idk how to build that so I will likely not get very far
at first
I don't care if anyone watches, I just want to do it and see how much progress I end up making
without using AI of course
cool 
what if you became a vtuber at the same time
I'll watch!
I clicked a link to "tangled instructions" on the maximal reconversions proposal doc and it was quicker to alt tab to the pdf in sumatrapdf and type and search for "tangled inst" than it was to load the link to the spirv docs
Unfortunately, maximal reconvergence cannot guarantee a single behavior for switch statements. There are too many different implementations for a switch statement, restricting the divergence and reconvergence behavior would have serious negative performance impacts on some implementations. Instead, shader authors should avoid switch statements in favor of if/else statements if they require guarantees about divergence and reconvergence.
hrm
I was thinking about spirv instruction count differences between vcc and slang and wondering if it actually matters
in the case of assembly fewer instructions translates to less work done by the CPU
but SPIR-V is an IR and not the end result
and maybe it all washes out in the end, and maybe it might even be the case that more instructions can result in the implementation optimizing better? idk
check out radeon gpu analyzer for a tool that can show actual gpu assembly
you can input glsl or spirv
Latest AMD drivers (AMD Software: Adrenalin Edition™ on Microsoft Windows® and amdgpu-pro on Linux®).
I think I need an AMD gpu to try it
let me see if nvidia has this
RGA works without an AMD GPU
oh, it's mentioned in the requirement section for the software
oh
For all non-offline modes (DirectX® 12, DXR, Vulkan®):
I'm going to try the two spvs I got from slang and vcc
that have the same functionality
I realize vcc is early phase, I'm just curious
the end goal is for spirv and implementers to support real language features on the GPU just like one can get with CUDA
on the GPU graphics pipeline I mean
neat!
that's the slang
this is vcc
vcc actually has fewer instructions for the vertex shader
pretty much similar
despite like 10x the spirv instructions
nice
more or less instructions doesnt always mean slower or faster
yes, instruction level parallelism can play a part where you enable the CPU to understand if instructions can be run in parallel
but think it makes a difference
on the GPU the whole uniform vs divergence plays in too yeah
which is what I was just reading about
the compiler could also roll or unroll code or generate instructions with more or less latency
GPUs have ILP too btw
but they don't necessarily have fancy graph analysis hardware to detect hazards and reorder instructions like CPUs do
I see
I edited the statement because some GPUs (e.g. pre-RDNA 3 AMD GPUs) do actually automatically track hazards
the amount of spirv difference was striking, but you just have to measure I guess to know if it is signficant and can't just go and wildly gesture at it and say "this bad"
you actually have to profile, to be able to say "this bad", unless you memorized each combination of instructions
yes
its like using fastinvsqrt on modern cpus these days, because its some assembly hackery it must be faster than it written out in plain c or something
the computer enhance course's main problem that you learn is to improve the performance of calculating the haversine distance of 1m pairs of locations extracted from a json file, part of it involves a sqrt function, so I guess the course will go over that part of the problem
I'm going to write my own gltf parser so I'm interested in the json part of that course
he picked json specifically because it was a poorly performing format that you encounter in the real world
I'm going to have to write my own profiler code since palinode is fully NIH, I hope the course covers that too
the basics seem obvious I guess
good luck
thanks!
this may alll seem like a lot but, this is all way less work than making a game heh
and I'm not stressing about progress
and more in line with what I actually want to do
ye no need to rush anything
which is to learn and build skill
I'm trying to convince this ai to let me merge my triangle code and it keeps finding things 
Fix format specifier for long variable.
The format specifier %d is incorrect for a long variable. This could cause undefined behavior or incorrect output.
I did do one of those videos today but even though I tested my mic in the video before, the full one hour my mic didn't record anything. I then tried a new video and it recorded audio too. I don't know what happened. I uploaded the video anyway, totally silent. If I redid the video I'd lose another hour and it wouldn't be really the first one, because I learned a lot in that hour. I also spent the last 20 minutes struggling because I didn't realize I had initialized my should_run main loop boolean as false and couldn't figure out why the window wasn't staying open. I thought I had gotten something wrong with the win32 API. I figured it out like 2 minutes before I ran out of time. You can't hear anything I said in my confusion or how much I laughed when I figured it out, but anyway. Each video I learn a lesson or two, and in this one it's to uh, read my own code.
it's fun to do tbh
I'm going to keep going with that
I kind of one to do another one today, but it's best for my learning if I don't do it twice in one day, for persistent memory
I'm going to maintain a public github repo with each attempts full code
Fast forward 2 years and we're on video day 685 and Bjorn is optimizing his string compare function for uOp cache usage
that's the dream
what got me interested in graphics programming wasn't really ever video games, it was the demo scene
what got me hooked on video games for a brief moment there was how much progress I had made and how fun it was to work on Blockens
I didn't understand it would actually escalate to be a game, until I started building something that looked like a world and it was fun and addicting to keep working on it
then I ran into problems with lack of not having fundamentals and I did the foundations thing, then retried my hand at a game with Rosy and it wasn't at all like Blockens, it was a slog
was blockens the zig one?
yeah
I made it private, but there's a thread with videos
foundations was also zig
zig and opengl go well together
well
before cimport got removed
I don't know what it's like now
there is translate-c and not so well documentated last time I checked translateC build stage
I like the devs working on it, but I'm happy with C
it's interesting, I woudln't have gotten into any of this if it wasn't for zig
what is precursor to zig experiment?
like 10 years ago I built a little 3D renderer with Metal
and had done some 2D software side draw things with Java and Kotlin
cool, I had some minecraft bukkit modding stuff and had some experiments with godot/unity but aside from that I always gatekept myself from gamedev itself "oh, you can't do it alone"
but it is my childhood dream, yeah
nice
I thought what demo scene people could do in 3D with a tiny bit of code was just so impressive to me and something I've always wanted to do, I don't really want to do all the things to make the program small, I just thought if they can do that with so little code I should be able to do something
I started to take it seriously during 2021/2022 and had many unsuccessful attempts with existing engines and my own NIH stuff. left my job during 2023 and somehow didn't starve yet XD

