-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Storage Support in AsBindGroup #6669
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
Conversation
What's the difference between this PR and #6129? |
It wasn't linked because I didn't even know the issue existed 😅 I only created that PR because I was playing with storage buffers and didn't see a PR. |
Also, it doesn't support any type, it only works for types that implement ShaderType. |
With #6129 merged, I'm closing this PR. If the solution in that PR doesn't fit the needs here, either open a new PR or rebase this one to add the missing features required. |
Having the example from this PR would still be worth it. @blaind let me know if you want to open a separate PR or change this one with the example. Otherwise I'll open one with only the example. |
This pull request supports a #6129 seems to have bevy-internal conversion, where the whole type is converted into a buffer on each update, and transferred from CPU to GPU at once. The example in this one is not usable for #6129 I think |
Can this one be reopened (I can't do it)? I'll rebase later to main later. |
For the example, I meant to have a similar example but updated to support #6129 If you see think both functionality can co-exist then that's even better |
# Objective There was PR that introduced support for storage buffer is `AsBindGroup` macro [#6129](#6129), but it does not give more granular control over storage buffer, it will always copy all the data no matter which part of it was updated. There is also currently another open PR #6669 that tries to achieve exactly that, it is just not up to date and seems abandoned (Sorry if that is not right). In this PR I'm proposing a solution for both of these approaches to co-exist using `#[storage(n, buffer)]` and `#[storage(n)]` to distinguish between the cases. We could also discuss in this PR if there is a need to extend this support to DynamicBuffers as well.
# Objective There was PR that introduced support for storage buffer is `AsBindGroup` macro [bevyengine#6129](bevyengine#6129), but it does not give more granular control over storage buffer, it will always copy all the data no matter which part of it was updated. There is also currently another open PR bevyengine#6669 that tries to achieve exactly that, it is just not up to date and seems abandoned (Sorry if that is not right). In this PR I'm proposing a solution for both of these approaches to co-exist using `#[storage(n, buffer)]` and `#[storage(n)]` to distinguish between the cases. We could also discuss in this PR if there is a need to extend this support to DynamicBuffers as well.
Added via #14663. |
Objective
Fixes #5499
Solution
#[storage(..)]
enum in AsBindGroup macroChangelog
Added
#[storage(..)]
enum in AsBindGroup macro