-
Notifications
You must be signed in to change notification settings - Fork 984
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
Conflict between type of HashMap
in PipelineCompilationOptions
and HashMap
exposed by the surface API
#7019
Comments
We really should just use a list hear, as much as I am not thrilled with it. |
Update Using The solution for now is using the latest commit [fcbadc9] before the expanded use of hashbrown [df54acc] in the crate. |
If you're up to it (or anyone else) this would be a pretty low lift issue to switch to lists. |
What list type should be used? |
Just a |
I think Looking for another solutionSo, I investigated a little the hashmaps used in the codebase:
The alias Solution: pub struct PipelineCompilationOptions<'a> {
pub constants: &'a naga::back::PipelineConstants,
...
} Final questions
Sorry about the wall of text. |
I'll respond to the whole wall of text tomorrow, but I would note that I would not treat the boilerplate of pipeline creation as hot code. Some small waste there is acceptable. I'm not worried about allocating a hashmap here interally. |
Description
Currently, the type
PipelineCompilationOptions
has a fieldconstants
of type that is directly defined ashashbrown::HashMap
.However, that type is not exposed to the surface API, making it impossible for the user to declare an object of the same type and then pass to
constants
(unless I am missing how this type is re-exported from the WGPU crate).Using
[FashHashMap](wgpu::naga::FastHashMap)
(which is an alias ofhashbrown::HashMap
) is also an error, as it uses a hasher different than the one thatconstants
expects. Bellow is the case of usingwgpu::naga::FastHashMap<>
:Error (minus personal information in the output):
Expected vs observed behavior
Either the hashmap type should be exposed in a way that will not cause confusion to the user, or
PipelineCompilationOptions
should use a generic type that then WGPU converts internally in whatever it uses.Platform
WGPU version: 65d499f
The text was updated successfully, but these errors were encountered: