You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…ne#4557)
# Objective
Fixesbevyengine#4556
## Solution
StorageBuffer must use the Size of the std430 representation to calculate the buffer size, as the std430 representation is the data that will be written to it.
exjam
pushed a commit
to exjam/bevy
that referenced
this issue
May 22, 2022
…ne#4557)
# Objective
Fixesbevyengine#4556
## Solution
StorageBuffer must use the Size of the std430 representation to calculate the buffer size, as the std430 representation is the data that will be written to it.
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
…ne#4557)
# Objective
Fixesbevyengine#4556
## Solution
StorageBuffer must use the Size of the std430 representation to calculate the buffer size, as the std430 representation is the data that will be written to it.
Bevy version
v0.7.0 and main branch 18c6a7b
Operating system & version
Archlinux
What you did
Create a StorageBuffer of items of types like:
then call
write_buffer
What you expected to happen
Buffer gets written to the queue without problems.
Internally:
scratch
gets resized to the size of the Std430 representation of the item typeWriter
writes the Std430 representation to thescratch
What actually happened
Buffer gets partially written to the queue and logs an
std::io::ErrorKind::WriteZero
Internally:
scratch
gets resized to the size of the item type (which is smaller than the Std430 representation due to missing padding)Writer
writes the Std430 representation to thescratch
, which is too small, and therefore errors.Additional information
All internal uses of StorageBuffer just happen to have data, which does not need to be padded to be aligned correctly.
I thew together a PR that should fix this (#4557)
The text was updated successfully, but these errors were encountered: