This specification describes support for rendering content for a WebXR session with WebGPU.
Status of this document
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this
technical report can be found in the W3C technical
reports index at http://www.w3.org/TR/.
Publication as an Editors' Draft does not imply endorsement by W3C and its Members. This is a draft document and may
be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite
this document as other than work in progress.
This document was produced by a group operating under the W3C Patent Policy.
W3C maintains a public list of any patent
disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential
Claim(s) must disclose the information in accordance with section
6 of the W3C Patent Policy.
WebGPU is an API for utilizing the graphics and compute capabilities of a device’s GPU more efficiently than WebGL allows, with an API that better matches both GPU hardware architecture and the modern native APIs that interface with them, such as Vulkan, Direct3D 12, and Metal.
1.1. Application flow
If an author wants to use WebGPU to render content for a WebXR Session, they must perform the following steps:
Draw the contents of the subimage using the GPUDevice the XRGPUBinding was created with.
2. Initialization
2.1. "webgpu" feature
If an application wants to use WebGPU for rendering during a session, the session MUST be requested with an appropriate feature descriptor. The string "webgpu" is introduced by this module as a new valid feature descriptor for the WebXR/WebGPU Bindings feature. XRSessions created with the webgpu feature are considered WebGPU-compatible sessions.
A WebGPU-compatible session MUST have the following behavioral from a WebGL-compatible session:
The projectionMatrix attribute of any XRView associated with the session will return a matrix appropriate for a clip-space depth range of [0, 1] instead of [-1, 1].
Conformance requirements are expressed
with a combination of descriptive assertions
and RFC 2119 terminology.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL”
in the normative parts of this document
are to be interpreted as described in RFC 2119.
However, for readability,
these words do not appear in all uppercase letters in this specification.
All of the text of this specification is normative
except sections explicitly marked as non-normative, examples, and notes. [RFC2119]
Examples in this specification are introduced with the words “for example”
or are set apart from the normative text
with class="example",
like this:
This is an example of an informative example.
Informative notes begin with the word “Note”
and are set apart from the normative text
with class="note",
like this:
Note, this is an informative note.
Conformant Algorithms
Requirements phrased in the imperative as part of algorithms
(such as "strip any leading space characters"
or "return false and abort these steps")
are to be interpreted with the meaning of the key word
("must", "should", "may", etc)
used in introducing the algorithm.
Conformance requirements phrased as algorithms or specific steps
can be implemented in any manner,
so long as the end result is equivalent.
In particular, the algorithms defined in this specification
are intended to be easy to understand
and are not intended to be performant.
Implementers are encouraged to optimize.