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
Fixed a bug where skybox ddsfile would crash from wgpu #12894
Conversation
7577733
to
eadc93c
Compare
…o read past the file buffer. Added a unit-test to prevent regression. Bumped ddsfile dependency version to 0.5.2
|
||
assert!(binary_offset < data.len()); | ||
assert!(end_offset <= data.len()); | ||
// data[binary_offset..end_offset]) |
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.
Debug?
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.
Not exactly. The commented line is how wgpu reads the data. I wanted to leave it here as a comment to show why the asserts are there.
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.
Looks fine to me. Just the comment that looks like it's left over from debugging/testing.
Improved reference code Co-authored-by: François Mockers <francois.mockers@vleue.com>
Fixed a bug where skybox ddsfile would crash from wgpu while trying to read past the file buffer.
Added a unit-test to prevent regression.
Bumped ddsfile dependency version to 0.5.2
Objective
Prevents a crash when loading dds skybox.
Solution
ddsfile already automatically sets array layers to be 6 for skyboxes. Removed bevy's extra *= 6 multiplication.
This is a copy of #12598 ... I made that one off of main and wasn't able to make more pull requests without making a new branch.