I'm slowly working through the vulkan spec writing a compute-only vulkan program from scratch that doesn't render anything, and it's going pretty well because the spec is really well written and I already know more or less exactly what I want to do anyway, but I just want to say just how silly (fun) it feels to write a program like this because you get to just skip over large swaths of the API.
Like, I'm working from the spec because the tutorials all make it more complicated.
I think it's cute that practically every vulkan command has one or more optional args to let you enter Hard Mode
(sorry for the double post, I added this to the wrong thread)
I wonder how many people have actually managed to knuckle down and write a complete, useful vulkan program from scratch (no copy pasting from tutorials and stack overflow, no offloading significant parts to 3rd party libraries like VMA)
To think if I power through and get this thing working I could potentially be like the 20th person to bother
oh, update on my little vulkan compute project, last night I got as far as repeatedly dispatching an empty compute shader and allocating some memory 😎 I'm in the home stretch! I think I just need to figure out the resources / resource binding stuff and then I'll be able to start on my DSP experiment :3
which mostly means the next things are figuring out the least effort way of getting audio data into C++ (probably stb_vorbis?) and writing even more boilerplate for alsa...
I reworked it so the convolution shader processes the audio in tandem with playback, so I'm *very* close to getting this working with live audio streams.
But more importantly, I used this to convolve my song "strange birds" with a choir-ish fanfare sound effect from a game I used to play as a kid and the result is like the grand cosmos opened up before me and I'm awash in the radiant light of the universe. Absolutely incredible.
ok the problem I'm having with latency now is that the audio latency in the system grows over time and I'm not sure why. like it starts snappy and after running for a short while it gets super laggy :/
I'm guessing it's because SDL3 can and will resize buffers as it wants to, whereas I'd rather it just go crazy if it under runs.
@aeva I was curious about this buffer-resize as I've done some audio code in the past, but not with SDL3(yet). that would be frustrating to write well-timed audio code if it dynamically resized things on the fly rather than doing audio dropouts on buffer exhaustion.
Iooks like there are hints you can set to force a buffer size in frames https://wiki.libsdl.org/SDL3/SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES
Not sure if this could help? It doesn't seem to promise this will work, so may still need to fetch the actual buffer size gotten back.
@aeva darn. hope you're able to figure out something there :< maybe audio backend specific, if you don't mind diving through sdl's code/statically linking stuff with symbols to do more debugging, but yeah these sorts of latency things are indeed messy if they (or the backend they wrap) don't give easy direct control over buffers.
either way curious to know what comes of it, since it's been really cool following your thread especially re:applying Vulkan for real-time audio!