Allowing users or even internal rendering logic access to compute shaders will provide a way of processing arbitrary data on the GPU. This can be used for everything from advanced lighting techniques, fast boid's calculations, and image processing.
Some key questions:
ShaderStages type expects to always have a vertex shader. I would suggest perhaps breaking this type up?As a reference for how a compute pass works here is a simple example of wgpu compute logic:
let pass = encoder.begin_compute_pass();
pass.set_pipeline(&pipeline.compute_pipeline);
pass.set_bind_group(0, &self.bind_group, &[]);
pass.dispatch(8, 8, 1); // The number of work groups(x, y, z).
I'm more than willing to work on adding compute shaders to bevy I just need some direction as to how I move forward considering the questions above. 馃檪
RenderResourceBindings to share data between nodes.RenderResourceContext::map_buffer approach, and a higher level Render Graph Node that uses map_buffer internally and copies to a specific resource or component.In general you have all of the compute shader experience here, so I think the best i can do at this point (without fully diving in) is give you the Bevy context you need. Feel free to ask for clarity where it is needed!
Most helpful comment
RenderResourceBindingsto share data between nodes.RenderResourceContext::map_bufferapproach, and a higher level Render Graph Node that uses map_buffer internally and copies to a specific resource or component.In general you have all of the compute shader experience here, so I think the best i can do at this point (without fully diving in) is give you the Bevy context you need. Feel free to ask for clarity where it is needed!