Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central gfx/wr #3883

Merged
merged 23 commits into from Mar 18, 2020
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fd7d948
Bug 1600793 - Make the scrolling input telemetry work for WebRender r…
sefeng211 Mar 13, 2020
a1d5938
Bug 1621758 - Fix occlusion rect of clipped compositor surfaces. r=ms…
Mar 13, 2020
0fe639d
Bug 1622327. Add support for adding profiling event markers to WebRen…
jrmuizel Mar 13, 2020
f17d613
Backed out changeset 2f04abdb752c (bug 1622327) for build bustage on …
ccoroiu Mar 13, 2020
9f2341a
Bug 1612941 - add deinit hook to WR Compositor trait. r=gw
Mar 14, 2020
d919041
Bug 1612941 - add SWGL glue to wrench. r=jrmuizel
Mar 14, 2020
9396fb2
Bug 1612941 - make WR report shader name and features in output for i…
Mar 14, 2020
84bab7f
Bug 1612941 - properly detect GL_ARB_texture_swizzle extension in WR.…
Mar 14, 2020
e83684e
Bug 1612941 - only upload partial GPU cache rows in WR when possible …
Mar 14, 2020
fde0ad2
Bug 1612941 - support variable depth buffer size in WR. r=gw
Mar 14, 2020
bac5c57
Bug 1612941 - force immediate upload method for SWGL since PBOs are s…
Mar 14, 2020
d7d3927
Bug 1612941 - WR shader changes to support SWGL instance attribs. r=j…
Mar 14, 2020
830a0e3
Bug 1612941 - update gleam version to allow implementation of Gl trai…
Mar 14, 2020
964e6c5
Bug 1612941 - vendor SWGL's rust dependencies. r=froydnj
Mar 14, 2020
b32e67c
Bug 1622520 - only run Renderbuffer cleanup code when erased. r=jrmuizel
Mar 14, 2020
3773615
Bug 1622668 - exclude swgl from CI test scripts. r=gw
Mar 16, 2020
7482bd3
Bug 1621390 - Optimize backdrop primitives by collapsing to clear col…
gw3583 Mar 16, 2020
19db2a4
Bug 1622256 - Replace use of description() with to_string(). r=kvark,…
staktrace Mar 17, 2020
6e3d6fe
Bug 1622256 - Remove unnecessary parentheses producing compiler warni…
staktrace Mar 17, 2020
537f681
Bug 1622591 - add missing YUV shader variations. r=jrmuizel
Mar 17, 2020
bbc57cf
Bug 1622720 - Add support for the tracy frame profiler to webrender. …
gw3583 Mar 17, 2020
dcac3cc
Bug 1618116 - Remove synchronous hit testing from WebRender's C++ wra…
nical Mar 17, 2020
2f3e55b
Bug 1615613 - Integrate the text shader in the brush infrastructure. …
nical Mar 17, 2020
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Bug 1621390 - Optimize backdrop primitives by collapsing to clear col…

  • Loading branch information
gw3583 authored and moz-gfx committed Mar 16, 2020
commit 7482bd33990f6abcac982ad0744db2735f06bf00
@@ -19,7 +19,8 @@ use crate::internal_types::{FastHashMap, SavedTargetIndex, Swizzle, TextureSourc
use crate::picture::{Picture3DContext, PictureCompositeMode, PicturePrimitive};
use crate::prim_store::{DeferredResolve, EdgeAaSegmentMask, PrimitiveInstanceKind, PrimitiveVisibilityIndex, PrimitiveVisibilityMask};
use crate::prim_store::{VisibleGradientTile, PrimitiveInstance, PrimitiveOpacity, SegmentInstanceIndex};
use crate::prim_store::{BrushSegment, ClipMaskKind, ClipTaskIndex, VECS_PER_SEGMENT, SpaceMapper};
use crate::prim_store::{BrushSegment, ClipMaskKind, ClipTaskIndex, PrimitiveVisibilityFlags};
use crate::prim_store::{VECS_PER_SEGMENT, SpaceMapper};
use crate::prim_store::image::ImageSource;
use crate::render_target::RenderTargetContext;
use crate::render_task_graph::{RenderTaskId, RenderTaskGraph};
@@ -193,6 +194,16 @@ impl AlphaBatchList {
}
}

/// Clear all current batches in this list. This is typically used
/// when a primitive is encountered that occludes all previous
/// content in this batch list.
fn clear(&mut self) {
self.current_batch_index = usize::MAX;
self.current_z_id = ZBufferId::invalid();
self.batches.clear();
self.item_rects.clear();
}

pub fn set_params_and_get_batch(
&mut self,
key: BatchKey,
@@ -290,6 +301,14 @@ impl OpaqueBatchList {
}
}

/// Clear all current batches in this list. This is typically used
/// when a primitive is encountered that occludes all previous
/// content in this batch list.
fn clear(&mut self) {
self.current_batch_index = usize::MAX;
self.batches.clear();
}

pub fn set_params_and_get_batch(
&mut self,
key: BatchKey,
@@ -502,6 +521,14 @@ impl AlphaBatchBuilder {
}
}

/// Clear all current batches in this builder. This is typically used
/// when a primitive is encountered that occludes all previous
/// content in this batch list.
fn clear(&mut self) {
self.alpha_batch_list.clear();
self.opaque_batch_list.clear();
}

pub fn build(
mut self,
batch_containers: &mut Vec<AlphaBatchContainer>,
@@ -653,6 +680,14 @@ impl BatchBuilder {
}
}

/// Clear all current batchers. This is typically used when a primitive
/// is encountered that occludes all previous content in this batch list.
fn clear_batches(&mut self) {
for batcher in &mut self.batchers {
batcher.clear();
}
}

/// Add a picture to a given batch builder.
pub fn add_pic_to_batch(
&mut self,
@@ -731,6 +766,16 @@ impl BatchBuilder {
let prim_info = &ctx.scratch.prim_info[prim_instance.visibility_info.0 as usize];
let bounding_rect = &prim_info.clip_chain.pic_clip_rect;

// If this primitive is a backdrop, that means that it is known to cover
// the entire picture cache background. In that case, the renderer will
// use the backdrop color as a clear color, and so we can drop this
// primitive and any prior primitives from the batch lists for this
// picture cache slice.
if prim_info.flags.contains(PrimitiveVisibilityFlags::IS_BACKDROP) {
self.clear_batches();
return;
}

let z_id = z_generator.next();

let prim_common_data = &ctx.data_stores.as_common_data(&prim_instance);
@@ -15,7 +15,7 @@ use crate::gpu_types::TransformData;
use crate::internal_types::{FastHashMap, PlaneSplitter, SavedTargetIndex};
use crate::picture::{PictureUpdateState, SurfaceInfo, ROOT_SURFACE_INDEX, SurfaceIndex, RecordedDirtyRegion};
use crate::picture::{RetainedTiles, TileCacheInstance, DirtyRegion, SurfaceRenderTasks, SubpixelMode};
use crate::picture::{TileCacheLogger};
use crate::picture::{BackdropKind, TileCacheLogger};
use crate::prim_store::{SpaceMapper, PictureIndex, PrimitiveDebugId, PrimitiveScratchBuffer};
use crate::prim_store::{DeferredResolve, PrimitiveVisibilityMask};
use crate::profiler::{FrameProfileCounters, TextureCacheProfileCounters, ResourceProfileCounters};
@@ -883,14 +883,19 @@ pub fn build_render_pass(
Some(color) => color.a >= 1.0,
None => false,
};
// TODO(gw): Once we have multiple slices enabled, take advantage of
// option to skip clears if the slice is opaque.
let clear_color = if forced_opaque {
let mut clear_color = if forced_opaque {
Some(ColorF::WHITE)
} else {
Some(ColorF::TRANSPARENT)
};

// If this picture cache has a valid color backdrop, we will use
// that as the clear color, skipping the draw of the backdrop
// primitive (and anything prior to it) during batching.
if let Some(BackdropKind::Color { color }) = tile_cache.backdrop.kind {
clear_color = Some(color);
}

// Create an alpha batcher for each of the tasks of this picture.
let mut batchers = Vec::new();
for task_id in &task_ids {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.