-
Couldn't load subscription status.
- Fork 301
Various render task refactors to help with upcoming caching changes. #2663
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
Conversation
|
r? @kvark Try run here - looks good from what I can tell (the orange appear to be unrelated or expected differences based on current master). The changes here are a bit opaque in ~~~purpose~~~ places, but I'm trying to make changes incrementally so the reviews are a bit easier. If you want to discuss in detail the reasoning for some of these items, or hold off until the upcoming PRs are ready, that's fine. |
|
Reviewed 11 of 11 files at r1. webrender/src/clip.rs, line 23 at r1 (raw file):
nit: should be an webrender/src/picture.rs, line 325 at r1 (raw file):
when is the size ever webrender/src/prim_store.rs, line 1212 at r1 (raw file):
can we get rid of webrender/src/render_task.rs, line 899 at r1 (raw file):
same here (re:enum) webrender/src/render_task.rs, line 1057 at r1 (raw file):
what if it's not valid? seems wrong to just ignore it here Comments from Reviewable |
* request_render_task() now returns a handle to a render task cache entry, rather than an allocated texture cache item. This is more in line with how normal texture cache request work. * Allows the allocation to happen later in the frame (for example if the exact render task size is not yet known). * Allows storing more information about a cached render task than what a texture cache item stores (for example, a specific blend mode that is required). * Allows batching code to cheaply look up a cached render task entry by using a freelist instead of a hashmap. This will become more important as we start to cache render tasks that have larger / more complex cache keys. * Add an extra type parameter to freelist.rs to allow using a custom marker type. This avoids rustc errors related to Send or Sync not being implemented on free list handles with !Send or !Sync phantom data types. * Allow the size of a render task to be set to None initially, if it is not known. * Add a new render task call (prepare_for_render) which can be used by render tasks to prepare tasks that rely on glyphs and/or images in the resource cache to be resolved first. This can also be used to set the size of a render task before render target allocation, if the render task size is not known during initial visibility pass.
|
Review status: 8 of 11 files reviewed at latest revision, 5 unresolved discussions. webrender/src/clip.rs, line 23 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/picture.rs, line 325 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Yup, that's right. webrender/src/prim_store.rs, line 1212 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
There are a couple of remaining places that use it, but we should be able to get rid of this in the near future, yes. webrender/src/render_task.rs, line 899 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
Done. webrender/src/render_task.rs, line 1057 at r1 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
If it's not valid (via a new cache entry or eviction) the request returns true and a render task is generated to build it. If request() returns false, the cache entry is already valid and no updates are required to the existing texture cache entry. Comments from Reviewable |
|
Reviewed 3 of 3 files at r2. Comments from Reviewable |
|
@bors-servo r+ |
|
📌 Commit dff0c11 has been approved by |
Various render task refactors to help with upcoming caching changes. * request_render_task() now returns a handle to a render task cache entry, rather than an allocated texture cache item. This is more in line with how normal texture cache request work. * Allows the allocation to happen later in the frame (for example if the exact render task size is not yet known). * Allows storing more information about a cached render task than what a texture cache item stores (for example, a specific blend mode that is required). * Allows batching code to cheaply look up a cached render task entry by using a freelist instead of a hashmap. This will become more important as we start to cache render tasks that have larger / more complex cache keys. * Add an extra type parameter to freelist.rs to allow using a custom marker type. This avoids rustc errors related to Send or Sync not being implemented on free list handles with !Send or !Sync phantom data types. * Allow the size of a render task to be set to None initially, if it is not known. * Add a new render task call (prepare_for_render) which can be used by render tasks to prepare tasks that rely on glyphs and/or images in the resource cache to be resolved first. This can also be used to set the size of a render task before render target allocation, if the render task size is not known during initial visibility pass. <!-- 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/2663) <!-- Reviewable:end -->
|
☀️ Test successful - status-appveyor, status-taskcluster |
request_render_task() now returns a handle to a render task
cache entry, rather than an allocated texture cache item. This
is more in line with how normal texture cache request work.
Allows the allocation to happen later in the frame (for example
if the exact render task size is not yet known).
Allows storing more information about a cached render task
than what a texture cache item stores (for example, a specific
blend mode that is required).
Allows batching code to cheaply look up a cached render task
entry by using a freelist instead of a hashmap. This will become
more important as we start to cache render tasks that have
larger / more complex cache keys.
Add an extra type parameter to freelist.rs to allow using a custom
marker type. This avoids rustc errors related to Send or Sync
not being implemented on free list handles with !Send or !Sync
phantom data types.
Allow the size of a render task to be set to None initially, if
it is not known.
Add a new render task call (prepare_for_render) which can be used
by render tasks to prepare tasks that rely on glyphs and/or images
in the resource cache to be resolved first. This can also be used
to set the size of a render task before render target allocation,
if the render task size is not known during initial visibility pass.
This change is