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

Don't cast the dynamic offsets count to u8 #5026

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

nical
Copy link
Contributor

@nical nical commented Jan 9, 2024

Connections

Supersedes #4918

Description

For some reason we store the dynamic offset count of the SetBindGroup command as a u8 even though it is used as an usize before and after. The conversion to u8 crashes if the number of offsets doesn't fit.

Checklist

  • Run cargo fmt.
  • Run cargo clippy.
  • Run cargo xtask test to run tests.

@nical nical changed the title Don't case the dynamic offsets count to u8 Don't cast the dynamic offsets count to u8 Jan 9, 2024
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Much better without all the conversions!

@nical nical merged commit 58fe7ea into gfx-rs:trunk Jan 9, 2024
28 checks passed
@nical nical deleted the dyn-offset-usize branch January 9, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants