Skip to content
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

Merged
merged 2 commits into from Apr 8, 2024

Conversation

Hexorg
Copy link
Contributor

@Hexorg Hexorg commented Apr 6, 2024

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.

@Hexorg Hexorg force-pushed the fix_dds_crash branch 3 times, most recently from 7577733 to eadc93c Compare April 6, 2024 18:55
…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])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug?

Copy link
Contributor Author

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.

Copy link
Contributor

@superdump superdump left a 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>
@mockersf mockersf added A-Rendering Drawing game state to the screen A-Assets Load files from disk to use for things like images, models, and sounds labels Apr 6, 2024
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Apr 8, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 8, 2024
Merged via the queue into bevyengine:main with commit b9a2329 Apr 8, 2024
34 checks passed
@Hexorg Hexorg deleted the fix_dds_crash branch April 14, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants