immersive-web / immersive-web/webxr-webgpu-binding

Supported texture formats

Open
#10 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bikeshed
Stars
87
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names WebGPU's supported context formats and the explainer's getPreferredColorFormat() method. Start by comparing the accepted color and depth/stencil combinations with the linked WebGPU rules, then resolve whether the spec should use a static list or advertised formats. Done means the supported list and preferred-format behavior are decided and the explainer/API text is consistent.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.