bevy/crates/bevy_render/src/render_resource
Robert Swain 0a4136d266 Add a helper for storage buffers similar to UniformVec (#4079)
# Objective

- Add a helper for storage buffers similar to `UniformVec`

## Solution

- Add a `StorageBuffer<T, U>` where `T` is the main body of the shader struct without any final variable-sized array member, and `U` is the type of the items in a variable-sized array.
- Use `()` as the type for unwanted parts, e.g. `StorageBuffer<(), Vec4>::default()` would construct a binding that would work with `struct MyType { data: array<vec4<f32>>; }` in WGSL and `StorageBuffer<MyType, ()>::default()` would work with `struct MyType { ... }` in WGSL as long as there are no variable-sized arrays.
- Std430 requires that there is at most one variable-sized array in a storage buffer, that if there is one it is the last member of the binding, and that it has at least one item. `StorageBuffer` handles all of these constraints.
2022-03-22 21:23:50 +00:00
..
bind_group_layout.rs Mesh vertex buffer layouts (#3959) 2022-02-23 23:21:13 +00:00
bind_group.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
buffer_vec.rs Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
buffer.rs small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
mod.rs Add a helper for storage buffers similar to UniformVec (#4079) 2022-03-22 21:23:50 +00:00
pipeline_cache.rs remove Events from bevy_app, they now live in bevy_ecs (#4066) 2022-03-01 19:33:56 +00:00
pipeline_specializer.rs Mesh vertex buffer layouts (#3959) 2022-02-23 23:21:13 +00:00
pipeline.rs Mesh vertex buffer layouts (#3959) 2022-02-23 23:21:13 +00:00
shader.rs shader preprocessor - do not import if scope is not valid (#4012) 2022-02-22 20:21:04 +00:00
storage_buffer.rs Add a helper for storage buffers similar to UniformVec (#4079) 2022-03-22 21:23:50 +00:00
texture.rs Fix doc_markdown lints in bevy_render (#3479) 2022-01-09 11:09:46 +00:00
uniform_vec.rs Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00