webxr: Use the same texture format as the original GL context's framebuffer when creating an XR GL layer.

This commit is contained in:
Josh Matthews 2019-09-19 17:46:09 -04:00
parent 778b48fa47
commit 5bd1e86d42
6 changed files with 43 additions and 17 deletions

View file

@ -110,16 +110,18 @@ impl XRWebGLLayer {
let mut pixels = CustomAutoRooter::new(None);
let mut clear_bits = constants::COLOR_BUFFER_BIT;
let formats = context.formats();
context.BindTexture(constants::TEXTURE_2D, Some(&texture));
let sc = context.TexImage2D(
constants::TEXTURE_2D,
0,
constants::RGBA,
formats.texture_format,
resolution.width,
resolution.height,
0,
constants::RGBA,
constants::UNSIGNED_BYTE,
formats.texture_format,
formats.texture_type,
pixels.root(*cx),
);