Skip to content

Refactor TextureViewDescriptor to match upstream spec better #848

@kvark

Description

@kvark

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp requiredWe need community help to make this happen.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions