-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Truncate attribute buffer data rather than attribute buffers #10270
Conversation
Existing truncation code limits the number of attribute buffers to be less than or equal to the number of vertices. Instead the number of elements from each attribute buffer should be limited to the length of the shortest buffer as mentioned in the earlier warning.
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 am surprised this hasn't caused any problems elsewhere... I guess we probably don't have any examples where there are more vertex attributes than vertices in a mesh?
This seems like an obvious good fix and holds up to some basic testing in generate_custom_mesh.rs
.
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.
maybe the original pr happened to fix the problem for me because i had an input with zero data for one of the attributes...
it was clearly wrong and this looks correct though.
…ine#10270) Existing truncation code limits the number of attribute buffers to be less than or equal to the number of vertices. Instead the number of elements from each attribute buffer should be limited to the length of the shortest buffer as mentioned in the earlier warning. # Objective - Fixes bevyengine#10267 ## Solution - Moves the `.take()` from the outer loop of attribute buffers, to the inner loop of attribute values. ---
…ine#10270) Existing truncation code limits the number of attribute buffers to be less than or equal to the number of vertices. Instead the number of elements from each attribute buffer should be limited to the length of the shortest buffer as mentioned in the earlier warning. # Objective - Fixes bevyengine#10267 ## Solution - Moves the `.take()` from the outer loop of attribute buffers, to the inner loop of attribute values. ---
Existing truncation code limits the number of attribute buffers to be less than or equal to the number of vertices.
Instead the number of elements from each attribute buffer should be limited to the length of the shortest buffer as mentioned in the earlier warning.
Objective
Solution
.take()
from the outer loop of attribute buffers, to the inner loop of attribute values.