Improve Storage Buffer example
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## How can Bevy's documentation be improved?
I recently stumbled across a small implementation detail in the storage buffer example, that is not clearly documented.
Apparently it is essential to borrow the `Materials` resource as mutable otherwise the update does not work.
So this does not give a compile error but fails silently to change the buffer data, resulting in me spending hours on desperate debugging:
```diff
// Update the material color by time
fn update(
time: Res
I think to save others from making this error, one could explicitly document and explain the need for a mutable borrow of `Materials`.
Otherwise, it would be ideal if this code results in a compile error but I do not know enough Rust sorcery to know if this is somehow possible.
Contributor guide
Research direction
Start at the storage buffer example and inspect the update function, especially the Materials resource, Assets, and ShaderStorageBuffer access shown in the issue. Document why Materials must be borrowed mutably for buffer updates to take effect, and verify the example still works with the explanation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100