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

Make Features fit in 64 bits again #5268

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Conversation

nical
Copy link
Contributor

@nical nical commented Feb 19, 2024

Description

u128 is not safe to pass in ffi, this causes issues in Gecko's ffi glue and blocks Firefox from updating to a newer wgpu-core revision.

There's #5247 on file about using the enumset crate but the latter also seems to use u128 when the number of bits required is between 64 and 128 so in the interest of unblocking gecko, this PR packs the used bits into u64, which is a simple transformation since we still have a fair amount of unused bits.
The PR also reorders the standard features so that they appear in the same order as in the spec.

To get more bits in the future I think that we should split webgpu and native features into separate types. That will give us a fair amount of extra bits on each side and if some day the native-only bits are full again we can consider having them use something that isn't ffi-safe (if that doesn't cause issues with wgpu-native). without causing as much trouble on the gecko side. At this rate it is going to take a very long time for the webgpu flags to overflow 64 bits if it ever happens and gecko needs them to be ffi-safe.

Checklist

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

@nical nical requested a review from a team as a code owner February 19, 2024 10:55
@cwfitzgerald
Copy link
Member

The failure is the GBV timeout issue

@cwfitzgerald cwfitzgerald merged commit a016a3a into gfx-rs:trunk Feb 19, 2024
27 checks passed
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