Backed out changeset 91859883a54d (bug 1538540) for causing tests crashes with [@ GeckoCrash] CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Wed, 01 May 2019 12:46:56 +0300
changeset 530876 ad490f39a317715e59875f6a630b60f345dd0bf6
parent 530875 6a3c75d8e68ad9e84c8f41f1accae69e13dd1210
child 530877 f8d2d04438931fccd53ba405b1ed5c394f296e15
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1538540
milestone68.0a1
backs out91859883a54dbdd7cc5376f379466ceb5e8b4e9b
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
Backed out changeset 91859883a54d (bug 1538540) for causing tests crashes with [@ GeckoCrash] CLOSED TREE
gfx/wr/webrender/src/internal_types.rs
gfx/wr/webrender/src/renderer.rs
gfx/wr/webrender/src/texture_cache.rs
--- a/gfx/wr/webrender/src/internal_types.rs
+++ b/gfx/wr/webrender/src/internal_types.rs
@@ -163,41 +163,31 @@ pub struct TextureCacheUpdate {
 
 /// Atomic set of commands to manipulate the texture cache, generated on the
 /// RenderBackend thread and executed on the Renderer thread.
 ///
 /// The list of allocation operations is processed before the updates. This is
 /// important to allow coalescing of certain allocation operations.
 #[derive(Default)]
 pub struct TextureUpdateList {
-    /// Indicates that there was some kind of cleanup clear operation. Used for
-    /// sanity checks.
-    pub clears_shared_cache: bool,
     /// Commands to alloc/realloc/free the textures. Processed first.
     pub allocations: Vec<TextureCacheAllocation>,
     /// Commands to update the contents of the textures. Processed second.
     pub updates: Vec<TextureCacheUpdate>,
 }
 
 impl TextureUpdateList {
     /// Mints a new `TextureUpdateList`.
     pub fn new() -> Self {
         TextureUpdateList {
-            clears_shared_cache: false,
             allocations: Vec::new(),
             updates: Vec::new(),
         }
     }
 
-    /// Sets the clears_shared_cache flag for renderer-side sanity checks.
-    #[inline]
-    pub fn note_clear(&mut self) {
-        self.clears_shared_cache = true;
-    }
-
     /// Pushes an update operation onto the list.
     #[inline]
     pub fn push_update(&mut self, update: TextureCacheUpdate) {
         self.updates.push(update);
     }
 
     /// Sends a command to the Renderer to clear the portion of the shared region
     /// we just freed. Used when the texture cache debugger is enabled.
--- a/gfx/wr/webrender/src/renderer.rs
+++ b/gfx/wr/webrender/src/renderer.rs
@@ -61,17 +61,17 @@ use frame_builder::{ChasePrimitive, Fram
 use gleam::gl;
 use glyph_rasterizer::{GlyphFormat, GlyphRasterizer};
 use gpu_cache::{GpuBlockData, GpuCacheUpdate, GpuCacheUpdateList};
 use gpu_cache::{GpuCacheDebugChunk, GpuCacheDebugCmd};
 #[cfg(feature = "pathfinder")]
 use gpu_glyph_renderer::GpuGlyphRenderer;
 use gpu_types::{PrimitiveHeaderI, PrimitiveHeaderF, ScalingInstance, TransformData, ResolveInstanceData};
 use internal_types::{TextureSource, ORTHO_FAR_PLANE, ORTHO_NEAR_PLANE, ResourceCacheError};
-use internal_types::{CacheTextureId, DebugOutput, FastHashMap, FastHashSet, LayerIndex, RenderedDocument, ResultMsg};
+use internal_types::{CacheTextureId, DebugOutput, FastHashMap, LayerIndex, RenderedDocument, ResultMsg};
 use internal_types::{TextureCacheAllocationKind, TextureCacheUpdate, TextureUpdateList, TextureUpdateSource};
 use internal_types::{RenderTargetInfo, SavedTargetIndex};
 use malloc_size_of::MallocSizeOfOps;
 use picture::{RecordedDirtyRegion, TileCache};
 use prim_store::DeferredResolve;
 use profiler::{BackendProfileCounters, FrameProfileCounters, TimeProfileCounter,
                GpuProfileTag, RendererProfileCounters, RendererProfileTimers};
 use profiler::{Profiler, ChangeIndicator};
@@ -1936,23 +1936,16 @@ pub struct Renderer {
 
     /// A lazily created texture for the zoom debugging widget.
     zoom_debug_texture: Option<Texture>,
 
     /// The current mouse position. This is used for debugging
     /// functionality only, such as the debug zoom widget.
     cursor_position: DeviceIntPoint,
 
-    /// Guards to check if we might be rendering a frame with expired texture
-    /// cache entries.
-    shared_texture_cache_cleared: bool,
-
-    /// The set of documents which we've seen a publish for since last render.
-    documents_seen: FastHashSet<DocumentId>,
-
     #[cfg(feature = "capture")]
     read_fbo: FBOId,
     #[cfg(feature = "replay")]
     owned_external_images: FastHashMap<(ExternalImageId, u8), ExternalTexture>,
 }
 
 #[derive(Debug)]
 pub enum RendererError {
@@ -2420,18 +2413,16 @@ impl Renderer {
             #[cfg(feature = "capture")]
             read_fbo,
             #[cfg(feature = "replay")]
             owned_external_images: FastHashMap::default(),
             notifications: Vec::new(),
             device_size: None,
             zoom_debug_texture: None,
             cursor_position: DeviceIntPoint::zero(),
-            shared_texture_cache_cleared: false,
-            documents_seen: FastHashSet::default(),
         };
 
         // We initially set the flags to default and then now call set_debug_flags
         // to ensure any potential transition when enabling a flag is run.
         renderer.set_debug_flags(debug_flags);
 
         let sender = RenderApiSender::new(api_tx, payload_tx);
         Ok((renderer, sender))
@@ -2486,18 +2477,16 @@ impl Renderer {
                     self.pipeline_info.removed_pipelines.extend(pipeline_info.removed_pipelines.drain(..));
                 }
                 ResultMsg::PublishDocument(
                     document_id,
                     doc,
                     texture_update_list,
                     profile_counters,
                 ) => {
-                    self.documents_seen.insert(document_id);
-
                     if doc.is_new_scene {
                         self.new_scene_indicator.changed();
                     }
 
                     // Add a new document to the active set, expressed as a `Vec` in order
                     // to re-order based on `DocumentLayer` during rendering.
                     match self.active_documents.iter().position(|&(id, _)| id == document_id) {
                         Some(pos) => {
@@ -3027,22 +3016,17 @@ impl Renderer {
             active_documents.sort_by_key(|&(_, ref render_doc)| render_doc.frame.layer);
 
             #[cfg(feature = "replay")]
             self.texture_resolver.external_images.extend(
                 self.owned_external_images.iter().map(|(key, value)| (*key, value.clone()))
             );
 
             let last_document_index = active_documents.len() - 1;
-            for (doc_index, (document_id, RenderedDocument { ref mut frame, .. })) in active_documents.iter_mut().enumerate() {
-                if self.shared_texture_cache_cleared {
-                    assert!(self.documents_seen.contains(&document_id),
-                            "Cleared texture cache without sending new document frame.");
-                }
-
+            for (doc_index, (_, RenderedDocument { ref mut frame, .. })) in active_documents.iter_mut().enumerate() {
                 frame.profile_counters.reset_targets();
                 self.prepare_gpu_cache(frame);
                 assert!(frame.gpu_cache_frame_id <= self.gpu_cache_frame_id,
                     "Received frame depends on a later GPU cache epoch ({:?}) than one we received last via `UpdateGpuCache` ({:?})",
                     frame.gpu_cache_frame_id, self.gpu_cache_frame_id);
 
                 self.draw_tile_frame(
                     frame,
@@ -3185,19 +3169,16 @@ impl Renderer {
             self.texture_resolver.end_frame(&mut self.device, cpu_frame_id);
             self.device.end_frame();
         });
 
         if device_size.is_some() {
             self.last_time = current_time;
         }
 
-        self.documents_seen.clear();
-        self.shared_texture_cache_cleared = false;
-
         if self.renderer_errors.is_empty() {
             Ok(results)
         } else {
             Err(mem::replace(&mut self.renderer_errors, Vec::new()))
         }
     }
 
     fn update_gpu_cache(&mut self) {
@@ -3400,20 +3381,16 @@ impl Renderer {
                                 None,
                                 Some(draw_target.to_framebuffer_rect(rect.to_i32()))
                             );
                             0
                         }
                     };
                     self.profile_counters.texture_data_uploaded.add(bytes_uploaded >> 10);
                 }
-
-                if update_list.clears_shared_cache {
-                    self.shared_texture_cache_cleared = true;
-                }
             }
 
             drain_filter(
                 &mut self.notifications,
                 |n| { n.when() == Checkpoint::FrameTexturesUpdated },
                 |n| { n.notify(); },
             );
         });
--- a/gfx/wr/webrender/src/texture_cache.rs
+++ b/gfx/wr/webrender/src/texture_cache.rs
@@ -619,18 +619,16 @@ impl TextureCache {
             );
 
             for handle in entry_handles {
                 let entry = self.entries.free(handle);
                 entry.evict();
                 self.free(&entry);
             }
         }
-
-        self.pending_updates.note_clear();
         self.per_doc_data = per_doc_data;
         self.require_frame_build = true;
     }
 
     fn clear_standalone(&mut self) {
         debug_assert!(!self.now.is_valid());
         self.clear_kind(EntryKind::Standalone);
     }