diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-09-23 19:34:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-23 19:34:10 -0400 |
commit | 6ca62aa0de1fda970daac53681a9b6e47cf91fbd (patch) | |
tree | 99715bdfa147c759c7f1a4eaf24d9123ac4303d6 /components/canvas/webgl_thread.rs | |
parent | ee17eedf3a857f27ce2b6b775574a3a455df8aa3 (diff) | |
parent | ea715a7a4cae5d2a2f41b059f36e08010d544de1 (diff) | |
download | servo-6ca62aa0de1fda970daac53681a9b6e47cf91fbd.tar.gz servo-6ca62aa0de1fda970daac53681a9b6e47cf91fbd.zip |
Auto merge of #24242 - jdm:xr-webgllayer-format, r=asajeffrey,nox
Fix immersive mode panic on three.js rollercoaster on hololens
We have some special logic about texture formats when creating drawing buffers for WebGL that needs to be shared with the code that creates a separate framebuffer for immersive mode.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24083 and fix #20595.
- [x] These changes do not require tests because no CI for hololens; tested manually in the emulator.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24242)
<!-- Reviewable:end -->
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r-- | components/canvas/webgl_thread.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index 612117c7095..c9007515ae4 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -238,7 +238,7 @@ impl WebGLThread { WebGLMsg::CreateContext(version, size, attributes, result_sender) => { let result = self.create_webgl_context(version, size, attributes); result_sender - .send(result.map(|(id, limits, share_mode)| { + .send(result.map(|(id, limits, share_mode, framebuffer_format)| { let data = Self::make_current_if_needed( id, &self.contexts, @@ -276,6 +276,7 @@ impl WebGLThread { share_mode, glsl_version, api_type, + framebuffer_format, } })) .unwrap(); @@ -406,7 +407,7 @@ impl WebGLThread { version: WebGLVersion, size: Size2D<u32>, attributes: GLContextAttributes, - ) -> Result<(WebGLContextId, GLLimits, WebGLContextShareMode), String> { + ) -> Result<(WebGLContextId, GLLimits, WebGLContextShareMode, GLFormats), String> { // Creating a new GLContext may make the current bound context_id dirty. // Clear it to ensure that make_current() is called in subsequent commands. self.bound_context_id = None; @@ -434,7 +435,7 @@ impl WebGLThread { .next_id(WebrenderImageHandlerType::WebGL) .0 as usize, ); - let (size, texture_id, limits) = ctx.get_info(); + let (size, texture_id, limits, framebuffer_formats) = ctx.get_info(); let use_apple_vertex_arrays = needs_apple_vertex_arrays(ctx.gl(), version); self.contexts.insert( id, @@ -458,7 +459,7 @@ impl WebGLThread { }, ); - Ok((id, limits, share_mode)) + Ok((id, limits, share_mode, framebuffer_formats)) } /// Resizes a WebGLContext @@ -476,7 +477,7 @@ impl WebGLThread { .expect("Missing WebGL context!"); match data.ctx.resize(size) { Ok(old_draw_buffer) => { - let (real_size, texture_id, _) = data.ctx.get_info(); + let (real_size, texture_id, _, _) = data.ctx.get_info(); let info = self.cached_context_info.get_mut(&context_id).unwrap(); if let ContextRenderState::Locked(ref mut in_use) = info.render_state { // If there's already an outdated draw buffer present, we can ignore |