Skip to content

Supported texture formats #10

@toji

Description

@toji

It was brought up that we will definitely want to limit the WebGPU texture formats which are accepted by the layer creation methods. For example: We probably don't want users requesting an r8sint color format with a stencil8 depth/stencil format.

WebGPU's solution for this regarding canvas integration is to limit the context to a narrow set of supported context formats. Specifically:

  • bgra8unorm
  • rgba8unorm
  • rgba16float

(There is no limit on depthStencil formats because unlike WebGL the canvas does not supply depthStencil buffers. They are managed manually by the developer.)

We should determine how we want to limit WebXR's accepted texture formats. Either by putting a static list in the spec like WebGPU or by explicitly advertising the formats that may be used (though even in that case I would advocate for picking a format or two that are always guaranteed to be supported.)

Also worth considering is that WebGPU advertises a "preferred" format for the device which will avoid unnecessary copies. We will likely want the same, and the explainer already contains a getPreferredColorFormat() method. We should consider if that needs to be updated based on how we handle the supported format list, and whether or not a getPreferredDepthStencil() format is also necessary.

CC @mwyrzykowski, @cabanier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions