Bug 1586062 - Fix WebRender with picture caching path disabled. r=kvark
authorGlenn Watson <git@intuitionlibrary.com>
Thu, 03 Oct 2019 19:32:09 +0000
changeset 496228 46c1d4bde8d44e821ad01e39aae82b4ae7f72f2d
parent 496227 973cd615817e91f1249dc19d2c1774e154031c85
child 496229 b58ea6f54a8bf864702f94f746fc265fbd786fc0
push id36647
push usernerli@mozilla.com
push dateFri, 04 Oct 2019 04:09:18 +0000
treeherdermozilla-central@678d4d2c3c4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark
bugs1586062
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1586062 - Fix WebRender with picture caching path disabled. r=kvark We need to detect this code path in renderer, and call the legacy draw_color_target method. Differential Revision: https://phabricator.services.mozilla.com/D48105
gfx/wr/webrender/src/renderer.rs
--- a/gfx/wr/webrender/src/renderer.rs
+++ b/gfx/wr/webrender/src/renderer.rs
@@ -1742,16 +1742,17 @@ pub struct Renderer {
     active_documents: Vec<(DocumentId, RenderedDocument)>,
 
     shaders: Rc<RefCell<Shaders>>,
 
     max_recorded_profiles: usize,
 
     clear_color: Option<ColorF>,
     enable_clear_scissor: bool,
+    enable_picture_caching: bool,
     enable_advanced_blend_barriers: bool,
 
     debug: LazyInitializedDebugRenderer,
     debug_flags: DebugFlags,
     backend_profile_counters: BackendProfileCounters,
     profile_counters: RendererProfileCounters,
     resource_upload_time: u64,
     gpu_cache_upload_time: u64,
@@ -2290,16 +2291,17 @@ impl Renderer {
             profiler: Profiler::new(),
             new_frame_indicator: ChangeIndicator::new(),
             new_scene_indicator: ChangeIndicator::new(),
             slow_frame_indicator: ChangeIndicator::new(),
             max_recorded_profiles: options.max_recorded_profiles,
             clear_color: options.clear_color,
             enable_clear_scissor: options.enable_clear_scissor,
             enable_advanced_blend_barriers: !ext_blend_equation_advanced_coherent,
+            enable_picture_caching: options.enable_picture_caching,
             last_time: 0,
             gpu_profile,
             vaos: RendererVAOs {
                 prim_vao,
                 blur_vao,
                 clip_vao,
                 border_vao,
                 scale_vao,
@@ -4715,17 +4717,17 @@ impl Renderer {
             );
             self.texture_resolver.bind(
                 &TextureSource::PrevPassColor,
                 TextureSampler::PrevPassColor,
                 &mut self.device,
             );
 
             match pass.kind {
-                RenderPassKind::MainFramebuffer { .. } => {
+                RenderPassKind::MainFramebuffer { ref main_target, .. } => {
                     if let Some(device_size) = device_size {
                         stats.color_target_count += 1;
 
                         let offset = frame.content_origin.to_f32();
                         let size = frame.device_rect.size.to_f32();
                         let projection = Transform3D::ortho(
                             offset.x,
                             offset.x + size.width,
@@ -4746,22 +4748,36 @@ impl Renderer {
                         if clear_framebuffer {
                             self.device.bind_draw_target(draw_target);
                             self.device.enable_depth_write();
                             self.device.clear_target(self.clear_color.map(|color| color.to_array()),
                                                      Some(1.0),
                                                      None);
                         }
 
-                        self.composite(
-                            &frame.composite_config,
-                            draw_target,
-                            &projection,
-                            stats,
-                        );
+                        if self.enable_picture_caching {
+                            self.composite(
+                                &frame.composite_config,
+                                draw_target,
+                                &projection,
+                                stats,
+                            );
+                        } else {
+                            self.draw_color_target(
+                                draw_target,
+                                main_target,
+                                frame.content_origin,
+                                None,
+                                None,
+                                &frame.render_tasks,
+                                &projection,
+                                frame_id,
+                                stats,
+                            );
+                        }
                     }
                 }
                 RenderPassKind::OffScreen {
                     ref mut alpha,
                     ref mut color,
                     ref mut texture_cache,
                     ref mut picture_cache,
                 } => {