-
Notifications
You must be signed in to change notification settings - Fork 970
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
Plan for When Features
overflows u64
#5247
Comments
From a glance at the code it looks like |
Due to the issue with |
sounds good! better to not take another dependency |
I would still prefer to use |
I think it's likely that we'll eventually run out of space for |
I just tried to see if I could alter There's a variety of things we can do long term. Splitting the flags probably being the simplest but I'm not particularly attached to it. I would prefer that the solution works well over ffi (without us having to do manually rewrite the flags). If it has to be rewritten on our side, then so be it, but it has to work with cbindgen. We still have 18 bits available, that gives some time for motivated individuals to fix enumset or try out other solutions. |
Resolution from meeting 10 months ago:
|
enumset
instead of u128
for feature flagsFeatures
overflows u64
I think To be clear, I agree that we should use two |
Is there a reason this needs to be compressed? It feels like a struct of bool feature flags would work pretty well for the public API, and internally it could still be compressed (either now or later). I mentioned this in an earlier comment but thought it might be worth reconsidering if this is ends up being a breaking change anyway. There's precedent for this in Vulkan, e.g., https://docs.vulkan.org/spec/latest/chapters/features.html#VkPhysicalDeviceFeatures Default initialization for a struct would also still work fine in Rust and C, so writing out the full struct wouldn't be necessary. The headers could eventually be versioned like Vulkan to support multiple structs over time (instead of adding fields). |
That's a good point. The C header is already doing something completely different (using strings like JS), but that may be more ergonomic. The features struct shouldn't be that big that we need to aggressively de-duplicate. It would also allow for more complex types than Bool. |
We just ran out of bits in the u64 feature flags in
wgpu::CommandEncoder::write_timestamp
#5188Using 128bit integers might be problematic on the web and is generally not scalable going forward. We should instead try to use
enumset
See also discussion in Matrix
The text was updated successfully, but these errors were encountered: