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
Separate brush segment descriptors from clip mask instances. #3289
Conversation
This also seems to give a small but noticeable performance win on some of the talos tests. Try run is not complete but looks good so far: |
Mentioned in the comments but repeating here too - the work here to maintain per-instance data between |
Try run looks good. |
6e34740
to
6dc08e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I have a few non-blocking concerns.
we can move the segmenting process to occur when a primitive is newly interned
where is this done?
Reviewed 10 of 10 files at r1.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @gw3583)
webrender/src/batch.rs, line 1419 at r1 (raw file):
// If a got a valid (or OPAQUE) clip task address, add the segment. if let Some(clip_task_address) = clip_task_address {
nit: just return early if it's None
?
webrender/src/batch.rs, line 2209 at r1 (raw file):
} impl PrimitiveStore {
does this have to be in batch module as opposed to the prim_store as all the rest of PrimitiveStore
logic?
webrender/src/frame_builder.rs, line 197 at r1 (raw file):
} self.prim_store.begin_frame();
nit: rename to something more specific, e.g. reset_clip_instances
?
webrender/src/prim_store.rs, line 887 at r1 (raw file):
if !clip_chain.needs_mask || (!self.may_need_clip_mask && !clip_chain.has_non_local_clips) { clip_mask_instances.push(ClipMaskKind::None);
does this function always end up just pushing one ClipMaskKind
? could it instead just return it?
webrender/src/render_task.rs, line 57 at r1 (raw file):
#[cfg(debug_assertions)] pub frame_id: FrameId,
does it need to be pub
?
☔ The latest upstream changes (presumably #3293) made this pull request unmergeable. Please resolve the merge conflicts. |
As part of interning primitives, we can move the segmenting process to occur when a primitive is newly interned (which is a significant optimization opportunity). We can do this since segmentation only occurs on clip nodes with the same spatial node as the primitive, thus the segmentation cannot be changed due to scrolling or transform animation. However, the presence of a clip mask per segment may still change each frame, due to clips from other positioning nodes. To handle this, we need to split the per-frame clip mask instance information from the brush segment descriptors. This is also a necessary step to allow borders to be interned, which rely on pre-generated segment descriptors. At the same time, make the size of a RenderTaskId smaller in release builds, and tidy up FrameId::invalid().
6dc08e9
to
0e04c9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 10 files reviewed, 3 unresolved discussions (waiting on @kvark)
webrender/src/batch.rs, line 1419 at r1 (raw file):
Previously, kvark (Dzmitry Malyshau) wrote…
nit: just return early if it's
None
?
Done
webrender/src/batch.rs, line 2209 at r1 (raw file):
Previously, kvark (Dzmitry Malyshau) wrote…
does this have to be in batch module as opposed to the prim_store as all the rest of
PrimitiveStore
logic?
It references a few symbols that are related to batching only, so I didn't think it made sense to be in prim_store. Instead, I've changed it to be a free helper function.
webrender/src/frame_builder.rs, line 197 at r1 (raw file):
Previously, kvark (Dzmitry Malyshau) wrote…
nit: rename to something more specific, e.g.
reset_clip_instances
?
Done
webrender/src/prim_store.rs, line 887 at r1 (raw file):
Previously, kvark (Dzmitry Malyshau) wrote…
does this function always end up just pushing one
ClipMaskKind
? could it instead just return it?
Indeed, that's much tidier. 👍
webrender/src/render_task.rs, line 57 at r1 (raw file):
Previously, kvark (Dzmitry Malyshau) wrote…
does it need to be
pub
?
Nope, fixed.
@kvark Those comments all made sense and have been fixed. Also rebased. |
@bors-servo r=kvark |
📌 Commit 47f5cf1 has been approved by |
Separate brush segment descriptors from clip mask instances. As part of interning primitives, we can move the segmenting process to occur when a primitive is newly interned (which is a significant optimization opportunity). We can do this since segmentation only occurs on clip nodes with the same spatial node as the primitive, thus the segmentation cannot be changed due to scrolling or transform animation. However, the presence of a clip mask per segment may still change each frame, due to clips from other positioning nodes. To handle this, we need to split the per-frame clip mask instance information from the brush segment descriptors. This is also a necessary step to allow borders to be interned, which rely on pre-generated segment descriptors. At the same time, make the size of a RenderTaskId smaller in release builds, and tidy up FrameId::invalid(). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3289) <!-- Reviewable:end -->
☀️ Test successful - status-appveyor, status-taskcluster |
Add default deserializer for frame_id Since frame ID is debug-only, it's not serialized when capturing from a release-built Firefox, making us unable to replay it with debug Wrench. This PR fixes this (broken recently by #3289). r? anyone <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3339) <!-- Reviewable:end -->
Add default deserializer for frame_id Since frame ID is debug-only, it's not serialized when capturing from a release-built Firefox, making us unable to replay it with debug Wrench. This PR fixes this (broken recently by #3289). r? anyone <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3339) <!-- Reviewable:end -->
As part of interning primitives, we can move the segmenting
process to occur when a primitive is newly interned (which is
a significant optimization opportunity). We can do this since
segmentation only occurs on clip nodes with the same spatial
node as the primitive, thus the segmentation cannot be changed
due to scrolling or transform animation.
However, the presence of a clip mask per segment may still
change each frame, due to clips from other positioning nodes.
To handle this, we need to split the per-frame clip mask instance
information from the brush segment descriptors.
This is also a necessary step to allow borders to be interned,
which rely on pre-generated segment descriptors.
At the same time, make the size of a RenderTaskId smaller in
release builds, and tidy up FrameId::invalid().
This change is