-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add buffer reuse and copy on resize. #22559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think we need to panic, we can just fall back to recreating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, done, that makes more sense, and yeah we should be checking the flag on image too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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.