Closed
Bug 1088414
Opened 9 years ago
Closed 8 years ago
Use a single synchronized texture for d3d11
Categories
(Core :: Graphics: Layers, defect)
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: mattwoodrow, Assigned: bas.schouten)
References
(Blocks 2 open bugs)
Details
(Whiteboard: sketchy)
Attachments
(1 file, 2 obsolete files)
22.65 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
Calling AcquireSync on textures created with D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX appears to be really slow, this really bites us with the number of textures involved when tiling. I've also tested using ID3D11Query to check when work is completed, this also appears to be pretty slow. This instead just uses a single texture with a keyedmutex, and makes sure we draw to it last and lock it first. It's pretty hacky, but seems to work really well so far.
Attachment #8510725 -
Flags: review?(bas)
Assignee | ||
Comment 1•9 years ago
|
||
Comment on attachment 8510725 [details] [diff] [review] sync-hack Review of attachment 8510725 [details] [diff] [review]: ----------------------------------------------------------------- This is really really dangerous. But let's do it :P.
Attachment #8510725 -
Flags: review?(bas)
Attachment #8510725 -
Flags: review+
Attachment #8510725 -
Flags: feedback?(jmuizelaar)
Comment 2•9 years ago
|
||
Comment on attachment 8510725 [details] [diff] [review] sync-hack Review of attachment 8510725 [details] [diff] [review]: ----------------------------------------------------------------- I guess we'll get more information having this in the tree than having it as a patch...
Attachment #8510725 -
Flags: feedback?(jmuizelaar) → feedback+
Comment 3•9 years ago
|
||
Comment on attachment 8510725 [details] [diff] [review] sync-hack Actually, I'd be a lot happier taking this if we hand a stand alone test case showing the performance problem and this fixing it.
Attachment #8510725 -
Flags: feedback+ → feedback-
Comment 4•9 years ago
|
||
There's perhaps a starting point here: https://github.com/jrmuizel/d3d-11-shared-surfaces
Comment 5•9 years ago
|
||
Let's do it!
Comment 7•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e2efedec2d60
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Comment 8•9 years ago
|
||
Comment on attachment 8510725 [details] [diff] [review] sync-hack Review of attachment 8510725 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/thebes/gfxWindowsPlatform.cpp @@ +1488,5 @@ > + RefPtr<IDXGIKeyedMutex> mutex; > + sentinelTexture->QueryInterface((IDXGIKeyedMutex**)byRef(mutex)); > + mutex->AcquireSync(0, INFINITE); > + mutex->ReleaseSync(0); > +} I'm not really convinced that this code is thread safe.... Also, FenceContentDrawing looks pretty sketchy to me. Shouldn't we AcquireSync at the beginning of drawing and ReleaseSync at the end instead of allocating a texture?
Comment 9•9 years ago
|
||
Comment on attachment 8510725 [details] [diff] [review] sync-hack Review of attachment 8510725 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/thebes/gfxWindowsPlatform.cpp @@ +1488,5 @@ > + RefPtr<IDXGIKeyedMutex> mutex; > + sentinelTexture->QueryInterface((IDXGIKeyedMutex**)byRef(mutex)); > + mutex->AcquireSync(0, INFINITE); > + mutex->ReleaseSync(0); > +} I misread CreateDrawTargetForD3D11Texture as CreateDrawTarget.
Comment 10•9 years ago
|
||
Comment on attachment 8510725 [details] [diff] [review] sync-hack Review of attachment 8510725 [details] [diff] [review]: ----------------------------------------------------------------- This also seems broken with e10s
Comment 11•9 years ago
|
||
I backed this out because of its brokeness: https://hg.mozilla.org/integration/mozilla-inbound/rev/d4c4897f9ffb
Comment 12•9 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #11) > I backed this out because of its brokeness: > https://hg.mozilla.org/integration/mozilla-inbound/rev/d4c4897f9ffb Hopefully, we'll be able to fix it up and reland soon.
Comment 14•8 years ago
|
||
We also get crashes here: https://crash-stats.mozilla.com/report/index/df756757-95df-4315-b64e-559572141116. Presumably because the draw target is no good.
Updated•8 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 15•8 years ago
|
||
Assignee: matt.woodrow → bas
Attachment #8510725 -
Attachment is obsolete: true
Attachment #8533916 -
Flags: review?(jmuizelaar)
Comment 16•8 years ago
|
||
Comment on attachment 8533916 [details] [diff] [review] Use a single sync texture for D3D11 Review of attachment 8533916 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Hopefully it works out. ::: gfx/layers/d3d11/TextureD3D11.cpp @@ +223,5 @@ > + > + MOZ_ASSERT(aSyncObject->GetSyncType() == SyncObject::SyncType::D3D11); > + > + SyncObjectD3D11* sync = static_cast<SyncObjectD3D11*>(aSyncObject); > + Add a comment like: // We copy into the Sync texture as a precaution to ensure ordering in the queue. Perhaps we can drop this if we can become confident of the queue ordering.
Attachment #8533916 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 17•8 years ago
|
||
Attachment #8533916 -
Attachment is obsolete: true
Attachment #8535639 -
Flags: review?(jmuizelaar)
Updated•8 years ago
|
Attachment #8535639 -
Flags: review?(jmuizelaar) → review+
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/dadec018f807 for breaking all non-Windows builds: https://treeherder.mozilla.org/ui/logviewer.html#?job_id=4614692&repo=mozilla-inbound I know Bas mentioned a fix in #developers, but it was taking too long and I need to step out for the night. Feel free to immediately reland with the fix applied, though.
Comment 19•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6d1f7a6e90a4
Status: REOPENED → RESOLVED
Closed: 9 years ago → 8 years ago
Resolution: --- → FIXED
Depends on: 1119066
Updated•7 years ago
|
Whiteboard: sketchy
You need to log in
before you can comment on or make changes to this bug.
Description
•