Support BindingType StorageTexture in AsBindGroup #7640
Description
What problem does this solve or what need does it fill?
Currently the AsBindGroup macro supports the BindingTypes
Uniform
, Texture
, Sampler
and Storage
.
Wgpu also has the BindingType type StorageTexture
which enables direct read/write access to textures without sampling (e.g. from a compute shader where samplers are not supported). This is currently not supported by the AsBindGroup macro.
For an example use case check out Bevy's compute_shader_game_of_life example. This example currently cannot be written using AsBindGroup.
What solution would you like?
The AsBindGroup derive macro should support the BindingType StorageTexture in ReadOnly, ReadWrite and WriteOnly configurations in order to enable compute shader processing of textures.
What alternative(s) have you considered?
Continue constructing BindGroups and BindGroupLayouts manually for this use case.
Additional context
The BindingType Storage was added in #6129. This PR could perhaps serve as reference for implementing the BindingType StorageTexture