euc icon indicating copy to clipboard operation
euc copied to clipboard

Compute shaders

Open jim-ec opened this issue 1 year ago • 3 comments

This crate would be perfect for prototyping compute shaders!

I am trying to write a fluid simulation. While the initial CPU-based approach works great, it is just not performant enough. Therefore I want to port it to a compute shader implementation. The problem with compute shaders is the same as vertex/fragment shaders: It is nearly impossible to debug them! Therefore, it would be awesome if this crate would support a compute pipeline with work groups, storage buffers, work group memory, etc. This would allow me to author an algorithm which is suited for a GPU all without loosing debugging capabilities.

jim-ec avatar Jun 22 '23 11:06 jim-ec

The difficulty here is that euc supports any valid Rust code in the shader implementation so there's no real way to encourage users to 'write for the GPU', as it were.

(I also don't personally know enough about compute shaders specifically to come up with a good model for this, but I guess that's par-for-the-course)

zesterer avatar Jun 22 '23 13:06 zesterer

That's actually even better, because it allows to adapt an algorithm for the GPU progressively. If I have time I can actually look into this myself, but I'll probably better wait for the refactoring branch to be merged anyway.

jim-ec avatar Jun 22 '23 14:06 jim-ec

The refactor branch is perhaps 99% there, and is basically fine to work from, I just need to find the time/energy to write a good line rasterizer.

zesterer avatar Jun 22 '23 14:06 zesterer