RenderDXGITextureHost::MapPlane() is called even when RenderCompositorD3D11SWGL uses external compositing for video rendering(sw-wr)
Categories
(Core :: Graphics: WebRender, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: sotaro, Assigned: mattwoodrow)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(2 files)
It seems that we do not need to call RenderDXGITextureHost::MapPlane() when external compositing is used video rendering. The MapPlane() seems to add extra cost.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
:mattwoodrow, can you comment to the bug?
Assignee | ||
Comment 2•4 years ago
|
||
What's the callstack to MapPlane()?
Are you seeing it happen during the same frames as we call AttachExternalImage, or does it just happen occasionally?
Reporter | ||
Comment 3•4 years ago
|
||
When I tested with the followings, I saw it during the same frames as we call AttachExternalImage.
- http://www.html5videoplayer.net/html5video/mp4-h-264-video-test/
- https://www.youtube.com/watch?v=1La4QzGeaaQ
call sequence was like the following.
RenderCompositorD3D11SWGL::BeginFrame() this 00000145916A2D40
RenderCompositorD3D11SWGL::AttachExternalImage() host 000001459D9EDDF0 this 00000145916A2D40
RenderDXGITextureHost::MapPlane() mSize(3840, 2160) this 000001459D9EDDF0
RenderDXGITextureHost::MapPlane() mSize(3840, 2160) this 000001459D9EDDF0
RenderCompositorD3D11SWGL::CompositorEndFrame() this 00000145916A2D40
RenderCompositorD3D11SWGL::CompositorEndFrame() host 000001459D9EDDF0 size(3840, 2160) this 00000145916A2D40
RenderCompositorD3D11SWGL::EndFrame() this 00000145916A2D40
Callstack was like the following
RenderDXGITextureHost::MapPlane()
RenderTextureHostSWGL::UpdatePlanes()
RenderTextureHostSWGL::LockSWGL()
wr_renderer_lock_external_image()
webrender_bindings::bindings::{{impl}}::lock()
Renderer::update_deferred_resolves()
Renderer::prepare_gpu_cache(w)
Renderer::render_impl()
webrender_bindings::bindings::wr_renderer_render()
RendererOGL::UpdateAndRender()
Assignee | ||
Comment 4•4 years ago
|
||
We're definitely calling resolve_image for all external_surfaces, even ones that are drawn by the native compositor - https://searchfox.org/mozilla-central/source/gfx/wr/webrender/src/composite.rs#659
Glenn, do you know which bits of this we can skip when we've promoted to a compositor external image (naming here is confusing).
Comment 5•4 years ago
|
||
The resolve_image
call is to get the texture id / layer / uv rect, which is used when the Draw
compositor is active.
I'm not too sure how / when / where we know that the external image itself is being handled by the compositor, but it does seem like we should be able to skip the resolve_image
and store different information in the external_surfaces
array in this case.
I think this will probably look a lot simpler when we eventually implement the Draw
compositor in terms of the main Compositor
trait, but I'm not sure when we'll have time to get to this.
It might be easier to discuss the details on matrix.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D98270
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D98271
Comment 9•4 years ago
|
||
Backed out 2 changesets (bug 1679482) for assertion failure at NativeLayerCA.
Backout link: https://hg.mozilla.org/integration/autoland/rev/8b5f6151cb49ea19426bc55a36d9b031ead97d3d
Failure log: https://treeherder.mozilla.org/logviewer?job_id=323386812&repo=autoland&lineNumber=2936
[task 2020-12-03T01:14:27.785Z] 01:14:27 INFO - TEST-START | dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html
[task 2020-12-03T01:14:27.856Z] 01:14:27 INFO - GECKO(1319) | [Parent 1319, IPDL Background] WARNING: Cannot record shutdown step, mConnection is nullptr: file /builds/worker/checkouts/gecko/dom/localstorage/ActorsParent.cpp:8039
[task 2020-12-03T01:14:27.856Z] 01:14:27 INFO - GECKO(1319) | [Child 1321, Main Thread] WARNING: Attempt to __delete__ missing or closed actor: file /builds/worker/workspace/obj-build/ipc/ipdl/PWebGLChild.cpp:117
[task 2020-12-03T01:14:27.856Z] 01:14:27 INFO - GECKO(1319) | [Child 1321, Main Thread] WARNING: Attempt to __delete__ missing or closed actor: file /builds/worker/workspace/obj-build/ipc/ipdl/PWebGLChild.cpp:117
[task 2020-12-03T01:14:27.856Z] 01:14:27 INFO - GECKO(1319) | [Child 1321, Main Thread] WARNING: Attempt to __delete__ missing or closed actor: file /builds/worker/workspace/obj-build/ipc/ipdl/PWebGLChild.cpp:117
[task 2020-12-03T01:14:27.856Z] 01:14:27 INFO - GECKO(1319) | [Child 1321, Main Thread] WARNING: Attempt to __delete__ missing or closed actor: file /builds/worker/workspace/obj-build/ipc/ipdl/PWebGLChild.cpp:117
[task 2020-12-03T01:14:27.891Z] 01:14:27 INFO - GECKO(1319) | [Parent 1319, IPDL Background] WARNING: Cannot record shutdown step, mConnection is nullptr: file /builds/worker/checkouts/gecko/dom/localstorage/ActorsParent.cpp:8039
[task 2020-12-03T01:14:27.954Z] 01:14:27 INFO - GECKO(1319) | [Child 1321, Main Thread] WARNING: IPC message discarded: actor cannot send: file /builds/worker/checkouts/gecko/ipc/glue/ProtocolUtils.cpp:512
[task 2020-12-03T01:14:27.954Z] 01:14:27 INFO - GECKO(1319) | [Child 1321, Main Thread] WARNING: Error sending reply: file /builds/worker/workspace/obj-build/ipc/ipdl/PDocumentChannelChild.cpp:288
[task 2020-12-03T01:14:28.019Z] 01:14:28 INFO - GECKO(1319) | [Child 1321, Main Thread] WARNING: Attempt to __delete__ missing or closed actor: file /builds/worker/workspace/obj-build/ipc/ipdl/PWebGLChild.cpp:117
[task 2020-12-03T01:14:28.019Z] 01:14:28 INFO - GECKO(1319) | [Parent 1319, IPDL Background] WARNING: Cannot record shutdown step, mConnection is nullptr: file /builds/worker/checkouts/gecko/dom/localstorage/ActorsParent.cpp:8039
[task 2020-12-03T01:14:28.069Z] 01:14:28 INFO - GECKO(1319) | Assertion failure: aTransform.Is2DIntegerTranslation(), at /builds/worker/checkouts/gecko/gfx/layers/NativeLayerCA.mm:895
[task 2020-12-03T01:14:28.073Z] 01:14:28 INFO - Initializing stack-fixing for the first stack frame, this may take a while...
[task 2020-12-03T01:14:35.825Z] 01:14:35 INFO - GECKO(1319) | #01: mozilla::layers::NativeLayerCA::ApplyChanges(mozilla::layers::NativeLayerRootCA::WhichRepresentation) [gfx/layers/NativeLayerCA.mm:813]
[task 2020-12-03T01:14:35.825Z] 01:14:35 INFO - GECKO(1319) | #02: mozilla::layers::NativeLayerRootCA::Representation::Commit(mozilla::layers::NativeLayerRootCA::WhichRepresentation, nsTArray<RefPtr<mozilla::layers::NativeLayerCA> > const&) [gfx/layers/NativeLayerCA.mm:293]
[task 2020-12-03T01:14:35.825Z] 01:14:35 INFO - GECKO(1319) | #03: mozilla::layers::NativeLayerRootCA::CommitToScreen() [gfx/layers/NativeLayerCA.mm:232]
[task 2020-12-03T01:14:35.825Z] 01:14:35 INFO - GECKO(1319) | #04: mozilla::wr::RenderCompositorNative::CompositorEndFrame() [gfx/webrender_bindings/RenderCompositorNative.cpp:283]
[task 2020-12-03T01:14:35.827Z] 01:14:35 INFO - GECKO(1319) | #05: webrender::renderer::Renderer::render_impl [gfx/wr/webrender/src/renderer.rs:3799]
[task 2020-12-03T01:14:35.827Z] 01:14:35 INFO - GECKO(1319) | #06: webrender::renderer::Renderer::render [gfx/wr/webrender/src/renderer.rs:3414]
[task 2020-12-03T01:14:35.827Z] 01:14:35 INFO - GECKO(1319) | #07: wr_renderer_render [gfx/webrender_bindings/src/bindings.rs:615]
[task 2020-12-03T01:14:35.827Z] 01:14:35 INFO - GECKO(1319) | #08: mozilla::wr::RendererOGL::UpdateAndRender(mozilla::Maybe<mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> > const&, mozilla::Maybe<mozilla::wr::ImageFormat> const&, mozilla::Maybe<mozilla::Range<unsigned char> > const&, bool*, mozilla::wr::RendererStats*) [gfx/webrender_bindings/RendererOGL.cpp:193]
[task 2020-12-03T01:14:35.827Z] 01:14:35 INFO - GECKO(1319) | #09: mozilla::wr::RenderThread::UpdateAndRender(mozilla::wr::WrWindowId, mozilla::layers::BaseTransactionId<mozilla::VsyncIdType> const&, mozilla::TimeStamp const&, bool, mozilla::Maybe<mozilla::gfx::IntSizeTyped<mozilla::gfx::UnknownUnits> > const&, mozilla::Maybe<mozilla::wr::ImageFormat> const&, mozilla::Maybe<mozilla::Range<unsigned char> > const&, bool*) [gfx/webrender_bindings/RenderThread.cpp:488]
[task 2020-12-03T01:14:35.827Z] 01:14:35 INFO - GECKO(1319) | #10: mozilla::wr::RenderThread::HandleFrameOneDoc(mozilla::wr::WrWindowId, bool) [gfx/webrender_bindings/RenderThread.cpp:325]
[task 2020-12-03T01:14:35.829Z] 01:14:35 INFO - GECKO(1319) | #11: mozilla::detail::RunnableMethodImpl<mozilla::wr::RenderThread*, void (mozilla::wr::RenderThread::*)(mozilla::wr::WrWindowId, bool), true, (mozilla::RunnableKind)0, mozilla::wr::WrWindowId, bool>::Run() [xpcom/threads/nsThreadUtils.h:1151]
[task 2020-12-03T01:14:35.829Z] 01:14:35 INFO - GECKO(1319) | #12: MessageLoop::RunTask(already_AddRefed<nsIRunnable>) [ipc/chromium/src/base/message_loop.cc:466]
[task 2020-12-03T01:14:35.829Z] 01:14:35 INFO - GECKO(1319) | #13: MessageLoop::DeferOrRunPendingTask(MessageLoop::PendingTask&&) [ipc/chromium/src/base/message_loop.cc:473]
[task 2020-12-03T01:14:35.829Z] 01:14:35 INFO - GECKO(1319) | #14: MessageLoop::DoWork() [ipc/chromium/src/base/message_loop.cc:548]
[task 2020-12-03T01:14:35.829Z] 01:14:35 INFO - GECKO(1319) | #15: base::MessagePumpDefault::Run(base::MessagePump::Delegate*) [ipc/chromium/src/base/message_pump_default.cc:35]
[task 2020-12-03T01:14:35.829Z] 01:14:35 INFO - GECKO(1319) | #16: MessageLoop::Run() [ipc/chromium/src/base/message_loop.cc:310]
[task 2020-12-03T01:14:35.829Z] 01:14:35 INFO - GECKO(1319) | #17: base::Thread::ThreadMain() [ipc/chromium/src/base/thread.cc:194]
[task 2020-12-03T01:14:35.829Z] 01:14:35 INFO - GECKO(1319) | #18: ThreadFunc(void*) [ipc/chromium/src/base/platform_thread_posix.cc:41]
[task 2020-12-03T01:14:35.831Z] 01:14:35 INFO - fix-stacks: error: failed to parse `/usr/lib/system/libsystem_pthread.dylib`
[task 2020-12-03T01:14:35.831Z] 01:14:35 INFO - fix-stacks: unsupported object file format
[task 2020-12-03T01:14:35.831Z] 01:14:35 INFO - GECKO(1319) | #19: _pthread_body [/usr/lib/system/libsystem_pthread.dylib + 0x32eb]
[task 2020-12-03T01:14:35.831Z] 01:14:35 INFO - GECKO(1319) | #20: _pthread_start [/usr/lib/system/libsystem_pthread.dylib + 0x6249]
[task 2020-12-03T01:14:35.831Z] 01:14:35 INFO - GECKO(1319) | [GFX1-]: Receive IPC close with reason=AbnormalShutdown
[task 2020-12-03T01:14:35.832Z] 01:14:35 INFO - GECKO(1319) | Exiting due to channel error.
[task 2020-12-03T01:14:35.832Z] 01:14:35 INFO - GECKO(1319) | Exiting due to channel error.
[task 2020-12-03T01:14:35.832Z] 01:14:35 INFO - GECKO(1319) | Exiting due to channel error.
[task 2020-12-03T01:14:35.835Z] 01:14:35 INFO - GECKO(1319) | Exiting due to channel error.
[task 2020-12-03T01:14:35.890Z] 01:14:35 INFO - TEST-INFO | Main app process: exit 1
[task 2020-12-03T01:14:35.890Z] 01:14:35 INFO - Buffered messages logged at 01:14:27
[task 2020-12-03T01:14:35.891Z] 01:14:35 INFO - TEST-PASS | dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html | A valid string reason is expected
[task 2020-12-03T01:14:35.891Z] 01:14:35 INFO - TEST-PASS | dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html | Reason cannot be empty
[task 2020-12-03T01:14:35.891Z] 01:14:35 INFO - Buffered messages logged at 01:14:28
[task 2020-12-03T01:14:35.891Z] 01:14:35 INFO - TEST-PASS | dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html | successfullyParsed is true
[task 2020-12-03T01:14:35.891Z] 01:14:35 INFO - Buffered messages finished
[task 2020-12-03T01:14:35.891Z] 01:14:35 ERROR - TEST-UNEXPECTED-FAIL | dom/canvas/test/webgl-conf/generated/test_conformance__context__context-attribute-preserve-drawing-buffer.html | application terminated with exit code 1
[task 2020-12-03T01:14:35.891Z] 01:14:35 INFO - runtests.py | Application ran for: 0:00:47.495735
Comment 10•4 years ago
|
||
The following also seem to start perma failing with the backed out changes:
https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&selectedTaskRun=PkI9gs2_QHGfbSm-GcwXmA.0&fromchange=54c0122f62a8b32b2adad47761781cede0e47e1d&searchStr=os%2Cx%2C10.14%2Cwebrender%2Copt%2Creftests%2Ctest-macosx1014-64-qr%2Fopt-reftest-e10s%2Cr8&tochange=2c61fdd0277b7ebb43c25258b92397308bbfdcca
https://treeherder.mozilla.org/logviewer?job_id=323386557&repo=autoland&lineNumber=9483
Comment 11•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 12•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/71a5b77cbbf4
https://hg.mozilla.org/mozilla-central/rev/cfaa73a15e66
Comment 13•4 years ago
|
||
(In reply to Pulsebot from comment #8)
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/41fc102c92a3
Don't compute external surface dependencies when not using the Draw
compositor. r=gw
== Change summary for alert #28040 (as of Thu, 10 Dec 2020 11:14:01 GMT) ==
Regressions:
Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|---|
25% | glterrain | windows10-64-qr | e10s stylo webgl-ipc webrender | 1.61 -> 2.01 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28040
Comment 14•4 years ago
|
||
(In reply to Pulsebot from comment #11)
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/71a5b77cbbf4
Refactor work for computing external surface dependencies into helper. r=gw
https://hg.mozilla.org/integration/autoland/rev/cfaa73a15e66
Don't compute external surface dependencies when not using the Draw
compositor. r=gw
== Change summary for alert #28039 (as of Thu, 10 Dec 2020 11:13:53 GMT) ==
Improvements:
Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|---|
18% | glterrain | windows10-64-qr | e10s stylo webgl-ipc webrender | 2.04 -> 1.68 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28039
Updated•4 years ago
|
Description
•