Replies: 8 comments 2 replies
-
@jim-ec I ran into this same challenge over the weekend. Your minimal wgpu example is insightful -- thank you for preparing that! I think that the 'proper' way to integrate with Bevy would be to derive the |
Beta Was this translation helpful? Give feedback.
-
I have also been stuck for like a week on this, an example would be lovely |
Beta Was this translation helpful? Give feedback.
-
@dennisorlando @shaneleonard @jim-ec I wrote up an example here: https://github.com/Andrewp2/bevy_compute_example . I'm not 100% this works or is the "bevy way" of handling it but I can see it does successfully get to the dispatch. |
Beta Was this translation helpful? Give feedback.
-
It's worth mentioning #6550 which does exactly that, only it kind of doesn't work because of the required WgpuFeatures::MAPPABLE_PRIMARY_BUFFERS flag and the fact that it was never merged, thus it's outdated and it doesn't work anymore |
Beta Was this translation helpful? Give feedback.
-
I'm also interested in 'how to read back the values to CPU' if a solution (or example code) finds it's way here. |
Beta Was this translation helpful? Give feedback.
-
Found this nice plugin: https://github.com/kjolnyr/bevy_app_compute |
Beta Was this translation helpful? Give feedback.
-
#12877 adds an example for this use case now! 🎉 |
Beta Was this translation helpful? Give feedback.
-
There is also this tutorial, which gives a detailed walk-trough over the compute game of life example in bevy. It is especially good, if you have to get a little bit into shaders and bevy render in general. Combined with the gpu readback example, it has a lot of potential. |
Beta Was this translation helpful? Give feedback.
-
I am trying to use a compute shader in my Bevy project but I find it very hard to understand how exactly to accomplish that. There is a compute shader example implementing Conway's Game of Life, but it uses textures instead of buffers which does not match my use case.
Bevy seems to have types related to this task such as the StorageBuffer, the problem is that I am not able to find any documentation or code which shows how to use it.
I prepared a minimal example which demonstrates a compute shader doubling a single input integer using just WGPU. It reads and writes the integer from a storage buffer.
It would be great if someone could help me translate that program to use Bevy.
Beta Was this translation helpful? Give feedback.
All reactions