Closed Bug 1688180 Opened 3 months ago Closed 2 months ago

The way render task update their uv rect handle is confusing

Categories

(Core :: Graphics: WebRender, task, P3)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: nical, Assigned: nical)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

  • Each task stores their own uv rect handle (or not in some cases), even though at the end of the day all tasks need one.
  • It took me quite a bit of reading to know for sure whether some of the tasks were storing their own rect or their source's (it's their own rect).
  • if the task is cached, the render task cache manages updating the uv rect handle and store it in the texture cache item, this is why some render tasks don't update their handles while others do even if they all have one eventually.

As a result:

  • Adding a render task requires reading a lot of code to figure out what example to follow.
  • render tasks are completely coupled with whether they are cached or not, down to their code.
  • lots of branchiness to deal with the same thing in different ways depending on whether the task is cached.

What I'd like instead:

The render task graph should deal with storing and updating all render task handles (not part of the render task kind anymore, and independent from whether the task is cached).

This patch removes from RenderTaskKind members that are independent from what the render task is drawing. The uv rect set automatically either to Some(handle) if the render task is not cached or to None if it is cached. This reflects what was happening implicitly before this patch. The uv rect kind defaults to Rect which is the most common case, but can be set when creating the render task.

This is a first step toward more flexibility when deciding whether a render task is cached or not (there is stil some coupling in the batching code between the type of primitive and whether their render tasks are cached).
More importantly, not having to understand what is up with presence or absence of uv handles in render tasks makes adding new ones much easier.

Blocks: 1692250
Attachment #9202614 - Attachment description: Bug 1688180 - Decouple the render task kind from whether it is cached (part 1). r=gw → Bug 1688180 - Decouple the render task kind from whether it is cached. r=gw
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3326216acbd9
Decouple the render task kind from whether it is cached. r=gw
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Regressions: 1692735
You need to log in before you can comment on or make changes to this bug.