Skip to content

Compute Shader Integration #3970

@kurtkuehnert

Description

@kurtkuehnert

What problem does this solve or what need does it fill?

For now Bevy does not have a dedicated compute pipeline abstraction, but only exposes the raw wgpu API for this use case.
The game of life example shows how to implement your own compute pipelines.

Currently there is no way to use Bevy's shader abstraction(shader defs, shader imports and hot shader reloading) for compute, which makes writing those shaders quite cumbersome.

What solution would you like?

I would like to have a way of turning a Handle<Shader> into a ShaderModule, which can be use for creating the compute pipeline.
For the render pipelines we use a RenderPipelineCache, which intern stores a ShaderCache, for processing the shaders.
We probably need something similar for compute pipelines (ComputePipelineCache), or we decouple the ShaderCache entirely from the RenderPipelineCache to cache all shaders in a single place (resource).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions