Expose underlying BindGroup in wrappers#104
Conversation
I've made the field on BindGroup wrappers public, in case a user needs to access the underlying wgpu::BindGroup. I've also made wrappers derive all the traits a wgpu::BindGroup implements.
|
I think this is fine, as we don't want to hide wgpu constructs anyway. |
I considered that. In wgsl_to_wgpu, they have a |
That's fine. Will accept either approach 👍 |
I've made the field on BindGroup wrappers public, in case a user needs to access the underlying wgpu::BindGroup. I've also made wrappers derive all the traits a wgpu::BindGroup implements.
Underlying
wgpu::BindGroups deriveHashso they can be used as keys in hashmaps, andCloneso their underlying handle can be safely cloned. With this PR, now the wrapper structs implement those traits as well.Exposing the underlying
wgpu::BindGroupwould be useful for situations where a user wants to use the wrapper structs in most situations, but has other places in their code that use rawwgpu::BindGroupand which they don't want to or can't update. I'm not sure if it's a concern that a user might construct a wrapper with an incompatiblewgpu::BindGroup.