Skip to content

WebGPU spec update: Enable 3D textures to be rendered #6040

@matthew-wong1

Description

@matthew-wong1

Is your feature request related to a problem? Please describe.
Hi! The WebGPU spec (from ~Oct 2023) now allows for a GPUTexture with a 3D dimension attribute to contain the usage RENDER_ATTACHMENT, but the current wgpu implementation does not yet support this.

Describe the solution you'd like
To allow for a 3D texture to be rendered, the renderPassDescriptor needs to contain a new attribute in colorAttachment (https://www.w3.org/TR/webgpu/#dom-gpucommandencoder-beginrenderpass). It must come with a colorAttachment.depthSlice (and this must not be included in renderpasses for textures with other dimensions). This new attribute would also need to be implemented.

Additional context

  1. A couple of checks need to be updated in: wgpu-core/src/device/resource.rs in the function create_texture (line 731 and line 922)
  2. A new check would be needed to make sure that only 3D textures in renderpasses include colorAttachment.depthSlice
  3. A unit test has been suggested in Allow 3D textures to be renderable #6004 (thanks wumpf!) - I'm happy to help write this and additional unit tests but unfortunately the backend implementation to support 3D textures to be rendered is a bit out of my depth right now

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions