bevy/crates/bevy_crevice/src
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
..
imp Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00
std140 Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00
std430 Add a helper for storage buffers similar to UniformVec (#4079) 2022-03-22 21:23:50 +00:00
glsl.rs Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00
imp.rs Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00
internal.rs Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00
lib.rs Enable the doc_markdown clippy lint (#3457) 2022-01-09 23:20:13 +00:00
std140.rs Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00
std430.rs Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00
util.rs Prepare crevice for vendored release (#3394) 2021-12-23 22:49:12 +00:00