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

Cache the current batch for both opaque and alpha batch lists. #3197

Merged
merged 2 commits into from Oct 15, 2018

Conversation

gw3583
Copy link
Contributor

@gw3583 gw3583 commented Oct 15, 2018

In the (near) future, we will want to support adding segments
where the texture may be different between segments (it is
currently assumed to be the same for all segments in a single
primitive). To do this efficiently, we need to be able to add
segments while switching batch only when necessary, so we now
cache the current batch in the batch lists, and re-use it if
the batch keys are compatible.

This is also a general optimization for opaque batches - this
patch allows the previously cached batch to be re-used for
different opaque primitives. This can avoid searching the
batch array when sequences of the same opaque primitive are
added.


This change is Reviewable

In the (near) future, we will want to support adding segments
where the texture may be different between segments (it is
currently assumed to be the same for all segments in a single
primitive). To do this efficiently, we need to be able to add
segments while switching batch only when necessary, so we now
cache the current batch in the batch lists, and re-use it if
the batch keys are compatible.

This is also a general optimization for opaque batches - this
patch allows the previously cached batch to be re-used for
different opaque primitives. This can avoid searching the
batch array when sequences of the same opaque primitive are
added.
@gw3583
Copy link
Contributor Author

gw3583 commented Oct 15, 2018

r? @nical or @kvark

Pending try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b0cfe8c974d0bc17a07125e0b0a5039c916242f4

This is about 7 steps removed from picture caching, but will make some necessary changes for that easier.

Specifically, we'll be able to make borders use a separate render task per edge / segment, which will allow segment building to take place during scene building, which will allow local clipping to be calculated during scene building, which will be important for some of the picture caching code I'm working on. 😬

@gw3583
Copy link
Contributor Author

gw3583 commented Oct 15, 2018

Added a follow up commit that adds the basic structure to using per-segment user data for the texture cache address in brush_image.

Kicked off a try run with that new commit:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2c0b065affa4ddb78ce3eb15e4a7c5b090cd453e

@nical
Copy link
Contributor

nical commented Oct 15, 2018

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit e795a19 has been approved by nical

@bors-servo
Copy link
Contributor

⌛ Testing commit e795a19 with merge b6747ff...

bors-servo pushed a commit that referenced this pull request Oct 15, 2018
Cache the current batch for both opaque and alpha batch lists.

In the (near) future, we will want to support adding segments
where the texture may be different between segments (it is
currently assumed to be the same for all segments in a single
primitive). To do this efficiently, we need to be able to add
segments while switching batch only when necessary, so we now
cache the current batch in the batch lists, and re-use it if
the batch keys are compatible.

This is also a general optimization for opaque batches - this
patch allows the previously cached batch to be re-used for
different opaque primitives. This can avoid searching the
batch array when sequences of the same opaque primitive are
added.

<!-- 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/3197)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: nical
Pushing b6747ff to master...

@bors-servo bors-servo merged commit e795a19 into servo:master Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants