In WebGPU spec, the descriptor has all the fields with meaningful default values. In wgpu-types today, the format and dimensions of the view are required fields. And texture_create_view method accepts Option<&wgt::TextureViewDescriptor<Label>>. We should instead make it so TextureViewDescriptor::default() is implemented, and matches the case in WebGPU where the user doesn't specify any fields, i.e texture.createView({}).
In order to implement Default for this structure, we need to turn format and dimension into options. Then we'd implement Default, and then we'd refactor texture_create_view into accepting a descriptor without an option. Finally, we'll update wgpu-rs to use the new API.
In WebGPU spec, the descriptor has all the fields with meaningful default values. In
wgpu-typestoday, the format and dimensions of the view are required fields. Andtexture_create_viewmethod acceptsOption<&wgt::TextureViewDescriptor<Label>>. We should instead make it soTextureViewDescriptor::default()is implemented, and matches the case in WebGPU where the user doesn't specify any fields, i.etexture.createView({}).In order to implement
Defaultfor this structure, we need to turnformatanddimensioninto options. Then we'd implementDefault, and then we'd refactortexture_create_viewinto accepting a descriptor without an option. Finally, we'll updatewgpu-rsto use the new API.