Closed Bug 1405481 Opened 8 years ago Closed 8 years ago

Push canvas updates to the compositor on empty transactions

Categories

(Core :: Graphics: WebRender, enhancement, P1)

Other Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- unaffected
firefox58 --- unaffected

People

(Reporter: kats, Assigned: sotaro)

References

Details

(Whiteboard: [wr-mvp] [gfx-noted])

Attachments

(2 files, 8 obsolete files)

13.43 KB, patch
jrmuizel
: review+
Details | Diff | Splinter Review
3.55 KB, patch
jrmuizel
: review+
Details | Diff | Splinter Review
We have some code that looks like it's supposed to send canvas updates to the compositor on empty transactions [1]. However it runs inside the layers-free block of EndTransactionInternal which only gets invoked accidentally. In bug 1403915 I'm moving the code around a bit, and commenting it out because it causes crashes if I run it where I want to run it. Somebody who knows what this code is doing should use this bug to fix it up and uncomment it. [1] http://searchfox.org/mozilla-central/rev/a4702203522745baff21e519035b6c946b7d710d/gfx/layers/wr/WebRenderLayerManager.cpp#817-824
Priority: P3 → P2
Whiteboard: [gfx-noted][wr-mvp][triage] → [wr-mvp] [gfx-noted]
Assignee: nobody → sotaro.ikeda.g
Bug 1405594 is related to this bug.
See Also: → 1405594
Status: NEW → ASSIGNED
Priority: P2 → P1
(In reply to Sotaro Ikeda [:sotaro] from comment #3) > https://treeherder.mozilla.org/#/ > jobs?repo=try&revision=d6d3f0560a0069efd6be9f4f1b380266a3cd7bb4 Some tests failed. Main reason of "application timed out after 330 seconds with no output" seemed to be caused by a thing that DidComposite did not triggered by EndEmptyTransaction().
Attachment #8915396 - Attachment is obsolete: true
Attachment #8915513 - Attachment is obsolete: true
Attachment #8915514 - Attachment is obsolete: true
(In reply to Sotaro Ikeda [:sotaro] from comment #4) > (In reply to Sotaro Ikeda [:sotaro] from comment #3) > > https://treeherder.mozilla.org/#/ > > jobs?repo=try&revision=d6d3f0560a0069efd6be9f4f1b380266a3cd7bb4 > > Some tests failed. Main reason of "application timed out after 330 seconds > with no output" seemed to be caused by a thing that DidComposite did not > triggered by EndEmptyTransaction(). I think I made a mistake when doing the new EndEmptyTransaction, I forgot to check for the EndTransactionFlags and do a composite if the flags don't contain END_NO_COMPOSITE. That fix should probably be a separate patch from the canvas updates thing.
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #8) > (In reply to Sotaro Ikeda [:sotaro] from comment #4) > > (In reply to Sotaro Ikeda [:sotaro] from comment #3) > > > https://treeherder.mozilla.org/#/ > > > jobs?repo=try&revision=d6d3f0560a0069efd6be9f4f1b380266a3cd7bb4 > > > > Some tests failed. Main reason of "application timed out after 330 seconds > > with no output" seemed to be caused by a thing that DidComposite did not > > triggered by EndEmptyTransaction(). > > I think I made a mistake when doing the new EndEmptyTransaction, I forgot to > check for the EndTransactionFlags and do a composite if the flags don't > contain END_NO_COMPOSITE. That fix should probably be a separate patch from > the canvas updates thing. Thanks! I am going to add a patch to skip composition if END_NO_COMPOSITE is set.
Rebased.
Attachment #8915517 - Attachment is obsolete: true
Attachment #8915817 - Attachment description: patch - Push canvas updates to the compositor on empty transactions → patch part 1 - Push canvas updates to the compositor on empty transactions
attachment 8915839 [details] [diff] [review] does not work well with "WebGL Lesson 3 – a bit of movement" sample. http://learningwebgl.com/lessons/lesson03/index.html On current nightly, the sample update is only 2-3 fps. attachment 8915819 [details] [diff] [review] addressed the low fps problem. But attachment 8915839 [details] [diff] [review] reverts the situation. From it, it seems that even when END_NO_COMPOSITE is set, if canvases have updates, WebRenderLayerManager needs to trigger composite.
Attachment #8915839 - Attachment is obsolete: true
Attachment #8915819 - Flags: review?(bugmail)
Attachment #8915861 - Flags: review?(bugmail)
Comment on attachment 8915819 [details] [diff] [review] patch part 1 - Push canvas updates to the compositor on empty transactions Review of attachment 8915819 [details] [diff] [review]: ----------------------------------------------------------------- There's a bunch of stuff in here that I'm not too familiar with, so bouncing to Jeff.
Attachment #8915819 - Flags: review?(bugmail) → review?(jmuizelaar)
Comment on attachment 8915861 [details] [diff] [review] patch part 2 - Suppress to composite when END_NO_COMPOSITE is set Review of attachment 8915861 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/wr/WebRenderLayerManager.cpp @@ +188,4 @@ > > + bool updated = mWebRenderCommandBuilder.EmptyTransaction(); > + > + if (aFlags & EndTransactionFlags::END_NO_COMPOSITE && !updated) { Do we need to call mWebRenderCommandBuilder.EmptyTransaction() after BeginTransaction() ? Because it would be more efficient to call mWebRenderCommandBuilder.EmptyTransaction() first, and then if it returns false (and we don't need a composite), we just call SendSetFocusTarget and return. That way we don't unnecessarily call BeginTransaction and CancelTransaction in the case where there are no canvases.
Attachment #8915861 - Flags: review?(bugmail) → review?(jmuizelaar)
Thanks for the advice :) I am going to update patches.
Attachment #8915819 - Flags: review?(jmuizelaar)
Attachment #8915861 - Flags: review?(jmuizelaar)
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #19) > > Do we need to call mWebRenderCommandBuilder.EmptyTransaction() after > BeginTransaction() ? Yes, it is necessary to mWebRenderCommandBuilder.EmptyTransaction() after WebRenderBridgeChild::BeginTransaction(). It is necessary for handling Compositable transaction related stuffs.
Attachment #8917225 - Flags: review?(jmuizelaar)
Attachment #8917227 - Flags: review?(jmuizelaar)
Comment on attachment 8917225 [details] [diff] [review] patch part 1 - Push canvas updates to the compositor on empty transactions Review of attachment 8917225 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/wr/WebRenderCommandBuilder.cpp @@ +37,5 @@ > + RefPtr<WebRenderCanvasData> canvasData = iter.Get()->GetKey(); > + WebRenderCanvasRendererAsync* canvas = canvasData->GetCanvasRenderer(); > + canvas->UpdateCompositableClient(); > + } > +} I wonder if this code should move out of the CommandBuilder
Attachment #8917225 - Flags: review?(jmuizelaar) → review+
Attachment #8917227 - Flags: review?(jmuizelaar) → review+
(In reply to Jeff Muizelaar [:jrmuizel] from comment #24) > Comment on attachment 8917225 [details] [diff] [review] > patch part 1 - Push canvas updates to the compositor on empty transactions > > Review of attachment 8917225 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: gfx/layers/wr/WebRenderCommandBuilder.cpp > @@ +37,5 @@ > > + RefPtr<WebRenderCanvasData> canvasData = iter.Get()->GetKey(); > > + WebRenderCanvasRendererAsync* canvas = canvasData->GetCanvasRenderer(); > > + canvas->UpdateCompositableClient(); > > + } > > +} > > I wonder if this code should move out of the CommandBuilder This could be done in a different bug.
(In reply to Sotaro Ikeda [:sotaro] from comment #25) > > > > Review of attachment 8917225 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > ::: gfx/layers/wr/WebRenderCommandBuilder.cpp > > @@ +37,5 @@ > > > + RefPtr<WebRenderCanvasData> canvasData = iter.Get()->GetKey(); > > > + WebRenderCanvasRendererAsync* canvas = canvasData->GetCanvasRenderer(); > > > + canvas->UpdateCompositableClient(); > > > + } > > > +} > > > > I wonder if this code should move out of the CommandBuilder > > This could be done in a different bug. I implemented the above in CommandBuilder just since CanvasDataSet and mLastCanvasDatas is defined in CommandBuilder.
Pushed by sikeda@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/86c487f84974 Push canvas updates to the compositor on empty transactions r=jrmuizel https://hg.mozilla.org/integration/mozilla-inbound/rev/077b6ec36d84 Suppress to composite when END_NO_COMPOSITE is set r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Depends on: 1408261
Depends on: 1408635
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: