Commit cb8b87d3 authored by Brandon Jones's avatar Brandon Jones Committed by Commit Bot

Force XRWebGLLayer.ignoreDepthValues to true

This value should only be false if the XR compositor is making use of
the layer's depth buffer, and since none of them do at the moment this
forces it to report true all the time.

Bug: 949810
Change-Id: I27e756983aebf4e173bcbf2485db28e06defbfa8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1554181Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649699}
parent 7401e32f
...@@ -72,7 +72,7 @@ XRWebGLLayer* XRWebGLLayer::Create( ...@@ -72,7 +72,7 @@ XRWebGLLayer* XRWebGLLayer::Create(
bool want_depth_buffer = initializer->depth(); bool want_depth_buffer = initializer->depth();
bool want_stencil_buffer = initializer->stencil(); bool want_stencil_buffer = initializer->stencil();
bool want_alpha_channel = initializer->alpha(); bool want_alpha_channel = initializer->alpha();
bool ignore_depth_values = initializer->ignoreDepthValues(); bool want_ignore_depth_values = initializer->ignoreDepthValues();
double framebuffer_scale = 1.0; double framebuffer_scale = 1.0;
...@@ -110,6 +110,16 @@ XRWebGLLayer* XRWebGLLayer::Create( ...@@ -110,6 +110,16 @@ XRWebGLLayer* XRWebGLLayer::Create(
return nullptr; return nullptr;
} }
// TODO: In the future this should be communicated by the drawing buffer and
// indicate whether the depth buffers are being supplied to the XR compositor.
bool compositor_supports_depth_values = false;
// The ignoreDepthValues attribute of XRWebGLLayer may only be set to false if
// the compositor is actually making use of the depth values and the user did
// not set ignoreDepthValues to true explicitly.
bool ignore_depth_values =
!compositor_supports_depth_values || want_ignore_depth_values;
return MakeGarbageCollected<XRWebGLLayer>( return MakeGarbageCollected<XRWebGLLayer>(
session, webgl_context, std::move(drawing_buffer), framebuffer, session, webgl_context, std::move(drawing_buffer), framebuffer,
framebuffer_scale, ignore_depth_values); framebuffer_scale, ignore_depth_values);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment