mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Support depth and stencil in webxr
This commit is contained in:
parent
714acb942c
commit
a9bb3f7181
3 changed files with 42 additions and 19 deletions
|
@ -240,7 +240,19 @@ impl XRWebGLLayer {
|
|||
0,
|
||||
)
|
||||
.ok()?;
|
||||
// TODO: depth/stencil
|
||||
if let Some(id) = sub_images.sub_image.as_ref()?.depth_stencil_texture {
|
||||
// TODO: Cache this texture
|
||||
let depth_stencil_texture_id = WebGLTextureId::maybe_new(id)?;
|
||||
let depth_stencil_texture = WebGLTexture::new(context, depth_stencil_texture_id);
|
||||
framebuffer
|
||||
.texture2d_even_if_opaque(
|
||||
constants::DEPTH_STENCIL_ATTACHMENT,
|
||||
constants::TEXTURE_2D,
|
||||
Some(&depth_stencil_texture),
|
||||
0,
|
||||
)
|
||||
.ok()?;
|
||||
}
|
||||
Some(())
|
||||
}
|
||||
|
||||
|
@ -253,6 +265,14 @@ impl XRWebGLLayer {
|
|||
framebuffer
|
||||
.texture2d_even_if_opaque(constants::COLOR_ATTACHMENT0, self.texture_target(), None, 0)
|
||||
.ok()?;
|
||||
framebuffer
|
||||
.texture2d_even_if_opaque(
|
||||
constants::DEPTH_STENCIL_ATTACHMENT,
|
||||
constants::DEPTH_STENCIL_ATTACHMENT,
|
||||
None,
|
||||
0,
|
||||
)
|
||||
.ok()?;
|
||||
framebuffer.upcast::<WebGLObject>().context().Flush();
|
||||
Some(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue