Bug 1641531 [wpt PR 23827] - Implement the ability to request XR compatibility on...
commit3e1fe7c88297384ae4ecf336b3cca12cc744929d
authorPatrick To <patrto@microsoft.com>
Wed, 10 Jun 2020 11:33:21 +0000 (10 11:33 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 12 Jun 2020 09:19:03 +0000 (12 09:19 +0000)
tree7eb8380a61c3efae1fdae7b90b33797a886ca961
parent5b35ec118e1a084a9b9e09731d297eea72a27397
Bug 1641531 [wpt PR 23827] - Implement the ability to request XR compatibility on a WebGL context., a=testonly

Automatic update from web-platform-tests
Implement the ability to request XR compatibility on a WebGL context.

This change is one part of a series of changes to add multi-GPU support
for VR. This CL contains the changes in Blink to request XR
compatibility on a WebGL context and send the request to the browser
process. There are two ways to do this - either calling
makeXRCompatible() on an existing WebGL context or setting the
xrCompatible flag in the context attributes:
canvas.getContext('webgl', { xrCompatible: true })

makeXRCompatible() returns a promise and sends an asynchronous request
to the browser process. Specifying the xrCompatible attribute is
synchronous, as getContext() must return a WebGL context that is
already compatible.

This CL doesn't change any functionality - the browser process
immediately returns compatibility status regardless of whether we're
XR compatible. A subsequent change will implement restarting the GPU
process if needed to be compatible with the VR headset.

This code was originally reviewed as part of a larger CL here:
https://chromium-review.googlesource.com/c/chromium/src/+/2096778

getContext('webgl2', { xrCompatible: true}) will be added in crbug.com/1087356

Bug: 876140
Change-Id: Iab6bf321d062023e7996dd5ffa84612f69ade95c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219780
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Patrick To <patrto@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#775856}

--

wpt-commits: abfd8c97298f0ead66597a37b8b87a79347df4f3
wpt-pr: 23827
testing/web-platform/tests/resources/chromium/webxr-test.js
testing/web-platform/tests/webxr/webGLCanvasContext_create_xrcompatible.https.html
testing/web-platform/tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html
testing/web-platform/tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html [new file with mode: 0644]
testing/web-platform/tests/webxr/xrWebGLLayer_constructor.https.html