Why are you uploading the colours buffer to the gpu. Couldn't you just define constants in the shader for it? Would be faster, since you don't need to transfer it from CPU to GPU anymore.
Fair point! Defining as a shader constant may speed things up further, not on the memory bus since I’m only transferring once at program creation, but by reducing the number of memory reads.
Loving this content! Will compute shaders be added to the C++ Vulkan tutorial? Additionally, is it possible to pass the result from a compute pass straight into a vertex shader? I mean without transferring the memory back to the host?
1: Yes! I'll probably use them for visibility tests. 2: Yes! In OpenGL this is actually the default behaviour. In this code I bind the storage buffer once at creation, the compute shader writes to it and the geometry shader (but could be any shader module at all) reads from it, no host involvement beyond synchronisation of shaders.
Looks like a list for a tile map...
Why are you uploading the colours buffer to the gpu. Couldn't you just define constants in the shader for it? Would be faster, since you don't need to transfer it from CPU to GPU anymore.
Fair point! Defining as a shader constant may speed things up further, not on the memory bus since I’m only transferring once at program creation, but by reducing the number of memory reads.
Loving this content! Will compute shaders be added to the C++ Vulkan tutorial?
Additionally, is it possible to pass the result from a compute pass straight into a vertex shader? I mean without transferring the memory back to the host?
1: Yes! I'll probably use them for visibility tests.
2: Yes! In OpenGL this is actually the default behaviour. In this code I bind the storage buffer once at creation, the compute shader writes to it and the geometry shader (but could be any shader module at all) reads from it, no host involvement beyond synchronisation of shaders.
@@GetIntoGameDev thank you so much! Looking forward to the corresponding Vulkan implementation. As always love the content!