Add buffer reuse and copy on resize.#22559
Conversation
crates/bevy_render/src/storage.rs
Outdated
| label: None, | ||
| size: 0, | ||
| usage: BufferUsages::STORAGE, | ||
| usage: BufferUsages::STORAGE | BufferUsages::COPY_DST, |
There was a problem hiding this comment.
is that needed for overwriting? i guess we should check for it before doing so then (in both prs)?
There was a problem hiding this comment.
Yeah, it's needed for write_buffer. Also, I just saw this on the WebGPU matrix:
We should maybe consider doing the same.
There was a problem hiding this comment.
Although I take your point about also checking, we should avoid panics where possible. I think we should maybe consider adding by default and then if the user removes they're responsible if their copies/etc no longer work.
There was a problem hiding this comment.
i don't think we need to panic, we can just fall back to recreating
There was a problem hiding this comment.
Yup, done, that makes more sense, and yeah we should be checking the flag on image too.
There was a problem hiding this comment.
(image default already includes COPY_DST and COPY_SRC)
…tion # Conflicts: # crates/bevy_render/src/storage.rs
|
Merge conflcits are non-trivial; please ping me when they're resolved :) |
|
this PR is causing crashes: #22609 |
Makes
ShaderStorageBufferhave parity withImagevis-a-vis #22552.We apply the same pattern used there here.