Don't delete GL textures created by WebXR

This commit is contained in:
Alan Jeffrey 2020-07-29 17:06:45 -05:00
parent 0d77e0f6cf
commit dfc641d648
2 changed files with 38 additions and 4 deletions

View file

@ -229,7 +229,7 @@ impl XRWebGLLayer {
// TODO: Cache this texture
let color_texture_id =
WebGLTextureId::maybe_new(sub_images.sub_image.as_ref()?.color_texture)?;
let color_texture = WebGLTexture::new(context, color_texture_id);
let color_texture = WebGLTexture::new_webxr(context, color_texture_id);
let target = self.texture_target();
// Save the current bindings
@ -263,7 +263,7 @@ impl XRWebGLLayer {
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);
let depth_stencil_texture = WebGLTexture::new_webxr(context, depth_stencil_texture_id);
framebuffer
.texture2d_even_if_opaque(
constants::DEPTH_STENCIL_ATTACHMENT,