Hi,
I would like to add compute shaders support to sokol_gfx, of course using a feature flag, this would introduce new flag to sg_buffer_desc and sg_image_desc, currently we have render_target for image.
I would like to add new sg_texture_usage flags which can follow metal convention maybe, texture can be shader_read, shader_write, render_target instead of having single boolean field?
Buffer can have sg_buffer_usage flag which ban be shader_read and shader_write as well.
What do you think?
I have some D3D12 and Vulkan focused development here and would love to use sokol
https://github.com/amerkoleci/alimer/blob/master/third_party/vgpu/include/vgpu/vgpu.h
I'm doing a very early draft version (currently D3d11) with the help of other contributors: sokol_gfx.h, here is the PR
It's very sketchy and still no support for buffers, but as you see in sg_image_desc, there is shader_write flag
compute and draw_indirect would be indeed very nice to have.
@septag has done a lot of work to implement these, but his work will probably not get merged https://github.com/septag/rizz/commits/master/3rdparty/sokol/sokol_gfx.h
please @floooh, tell us you have a plan :)
Compute support definitely isn't off the table, I'm currently just distracted by other things (mostly emulator stuff), and there's a few smaller features on "backlog" which also need fixing :)
Now that you have added WebGPU backend. it may be a good time to consider it. and I'm willing to help on D3d11 and OpenGL backends.
Here is a proof of concept for d3d11 backend:
https://github.com/septag/sokol/blob/compute-shaders/sokol_gfx.h
It's in sync with your current changes, so you can diff it
which is tested with an example (wrapped in my own engine):
https://github.com/septag/rizz/tree/master/examples/07-nbody
Most helpful comment
Now that you have added WebGPU backend. it may be a good time to consider it. and I'm willing to help on D3d11 and OpenGL backends.
Here is a proof of concept for d3d11 backend:
https://github.com/septag/sokol/blob/compute-shaders/sokol_gfx.h
It's in sync with your current changes, so you can diff it
which is tested with an example (wrapped in my own engine):
https://github.com/septag/rizz/tree/master/examples/07-nbody