Skip to content

feat(xr): backend-aware WebXR support detection (isDeviceSupported)#8948

Merged
mvaligursky merged 1 commit into
mainfrom
mv-xr-device-supported
Jun 23, 2026
Merged

feat(xr): backend-aware WebXR support detection (isDeviceSupported)#8948
mvaligursky merged 1 commit into
mainfrom
mv-xr-device-supported

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Adds a way to detect whether a WebXR session can run on a given graphics backend, and makes the existing reactive XR availability backend-aware. This is needed because WebGPU WebXR is supported only on a subset of platforms, whereas WebGL WebXR has wider support — so the same headset can support a session under WebGL but not under WebGPU.

Changes:

  • Add a static XrManager.isDeviceSupported(deviceType, type) reporting whether an immersive session of the given type can run on a given graphics backend. It can be called before a graphics device is created, so an app can decide which backend to request for XR.
  • The reactive availability (XrManager#isAvailable and the available / available:[type] events) now accounts for the active graphics backend. Previously it reflected only what the browser/headset reported regardless of backend, so on a WebGPU device a session could be reported available when it could not actually start. WebGL behavior is unchanged.

API Changes:

  • New: XrManager.isDeviceSupported(deviceType: string, type: string): Promise<boolean> (static).
  • Behavior change (no signature change): XrManager#isAvailable(type) and the available / available:[type] events are now backend-aware. WebGL results are identical; WebGPU results are now accurate — a session is reported available only if it can actually run on the current device.

@github-actions

Copy link
Copy Markdown

Public API report

This PR changes the public API surface (+1 / −0), per the docs' rules (@ignore / @Private / undocumented are excluded).

Show API diff
+XrManager.static isDeviceSupported(deviceType: string, type: string): Promise<boolean>

Informational only — this never fails the build.

@github-actions

Copy link
Copy Markdown

Build size report

This PR changes the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2283.0 KB (+0.3 KB, +0.01%) 585.6 KB (+0.1 KB, +0.02%) 455.0 KB (−0.2 KB, −0.03%)
playcanvas.min.mjs 2280.5 KB (+0.3 KB, +0.01%) 584.8 KB (+0.1 KB, +0.02%) 454.9 KB (+0.3 KB, +0.06%)

@mvaligursky mvaligursky merged commit 9ed0f67 into main Jun 23, 2026
10 checks passed
@mvaligursky mvaligursky deleted the mv-xr-device-supported branch June 23, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant