Closed
Bug 756606
Opened 13 years ago
Closed 11 years ago
[Meta] Implement OMTC for Direct3D 11
Categories
(Core :: Graphics: Layers, defect)
Core
Graphics: Layers
Tracking
()
VERIFIED
FIXED
mozilla28
Tracking | Status | |
---|---|---|
firefox28 | --- | verified |
People
(Reporter: joe, Assigned: nrc)
References
Details
(Whiteboard: [metro-mvp][LOE:3][leave open])
Attachments
(6 files, 3 obsolete files)
(deleted),
patch
|
bas.schouten
:
review+
nrc
:
checkin+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bas.schouten
:
review+
nrc
:
checkin+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
nrc
:
review+
nrc
:
checkin+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bas.schouten
:
review+
nrc
:
checkin+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bas.schouten
:
review+
nrc
:
checkin+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bas.schouten
:
review+
nrc
:
checkin+
|
Details | Diff | Splinter Review |
We need to implement OMTC for Direct3D 10. This bug will track that implementation.
Updated•13 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Reporter | ||
Updated•12 years ago
|
Blocks: metro-omtc
Updated•12 years ago
|
Whiteboard: metro-beta
Updated•12 years ago
|
Whiteboard: metro-beta → [metro-mvp]
Reporter | ||
Updated•12 years ago
|
Assignee: nobody → bas
Updated•12 years ago
|
Whiteboard: [metro-mvp] → [metro-mvp][LOE:3]
Comment 1•12 years ago
|
||
Do we have a sense of how this work is progressing? Also, is there anything metro team members can do to help?
My understanding is that we need to use the async scroller in the layers system for pan and zoom, and that this requires OMTC to work. So we have a lot of bugs blocked on omtc for Windows.
Updated•12 years ago
|
No longer blocks: metro-omtc
Assignee | ||
Comment 2•11 years ago
|
||
Just for giggles, I tried flicking this on and doing a Try push: https://tbpl.mozilla.org/?tree=Try&rev=20a80d5f4143
Looks like we fail to initialise the compositor everywhere except Win8. Is that because we are missing libraries on the test machines? We're not particularly green even on Win8.
Assignee | ||
Comment 3•11 years ago
|
||
Looks like the Win8 debug orange is mostly due to a bad assertion that can be easily fixed - should assert that texture is shmem || memory image, but just checks for shmem.
Updated•11 years ago
|
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #771137 -
Flags: review?
Updated•11 years ago
|
Attachment #771137 -
Flags: review? → review?(bas)
Updated•11 years ago
|
Attachment #771137 -
Flags: review?(bas) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Whiteboard: [metro-mvp][LOE:3] → [metro-mvp][LOE:3][leave open]
Comment 6•11 years ago
|
||
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #776937 -
Flags: review?(bas)
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #776942 -
Flags: review?(bas)
Assignee | ||
Comment 9•11 years ago
|
||
Attachment #776942 -
Attachment is obsolete: true
Attachment #776942 -
Flags: review?(bas)
Attachment #776960 -
Flags: review?(bas)
Updated•11 years ago
|
Summary: [Meta] Implement OMTC for Direct3D 10 → [Meta] Implement OMTC for Direct3D 11
Comment 10•11 years ago
|
||
Comment on attachment 776937 [details] [diff] [review]
bug fix for resizing windows ugliness
Review of attachment 776937 [details] [diff] [review]:
-----------------------------------------------------------------
I wonder if we can create a test for this. Very silly of me, nice catch.
Attachment #776937 -
Flags: review?(bas) → review+
Comment 11•11 years ago
|
||
Comment on attachment 776960 [details] [diff] [review]
formatting - getting my ocd on
Review of attachment 776960 [details] [diff] [review]:
-----------------------------------------------------------------
Can we only break lines which are over 100 characters? I find a lot of these changes disastrously ugly.
::: gfx/layers/d3d11/CompositorD3D11.cpp
@@ +56,5 @@
> RefPtr<ID3D11BlendState> mPremulBlendState;
> RefPtr<ID3D11BlendState> mNonPremulBlendState;
> };
>
> +CompositorD3D11::CompositorD3D11(nsIWidget* aWidget)
I actually prefer the other style. I don't think our style guide offers any hints here so I guess we'll have to fight to the death :-).
::: gfx/layers/d3d11/CompositorD3D11.h
@@ +135,5 @@
>
> virtual nsIWidget* GetWidget() const MOZ_OVERRIDE { return mWidget; }
> virtual const nsIntSize& GetWidgetSize() MOZ_OVERRIDE;
>
> + ID3D11Device* GetDevice() { return mDevice; }
Similar style disagreements here :)
@@ +159,5 @@
>
> + nsIWidget* mWidget;
> + // GetWidgetSize requires us to return a reference to an nsIntSize. Since we
> + // don't otherwise keep this value around, we need mSize to avoid a dangling
> + // reference problem.
How about we -not- make it return a reference? :P
Comment 12•11 years ago
|
||
(In reply to Bas Schouten (:bas.schouten) from comment #11)
> Comment on attachment 776960 [details] [diff] [review]
> formatting - getting my ocd on
>
> Review of attachment 776960 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Can we only break lines which are over 100 characters? I find a lot of these
> changes disastrously ugly.
>
> ::: gfx/layers/d3d11/CompositorD3D11.cpp
> @@ +56,5 @@
> > RefPtr<ID3D11BlendState> mPremulBlendState;
> > RefPtr<ID3D11BlendState> mNonPremulBlendState;
> > };
> >
> > +CompositorD3D11::CompositorD3D11(nsIWidget* aWidget)
>
> I actually prefer the other style. I don't think our style guide offers any
> hints here so I guess we'll have to fight to the death :-).
Wait, somebody with no sense of style whatsoever seems to have edited the style guide an said pointer *'s need to snuggle with the types :P. I'm going to try and figure out where that decision happened and whether I can fight them to the death instead :-).
Comment 13•11 years ago
|
||
Comment on attachment 776960 [details] [diff] [review]
formatting - getting my ocd on
Review of attachment 776960 [details] [diff] [review]:
-----------------------------------------------------------------
I talked about this a little on IRC and I'd prefer we did the line breaking a little more with human judgement. When the length is longer than a 100 characters I'd say it's a pretty strong limit so readability needs to be significantly improved for it to stay on one line. Between 80 and 100 I think in general it depends on what reads better.
::: gfx/layers/d3d11/CompositorD3D11.cpp
@@ +722,5 @@
>
> + hr = mDevice->CreateVertexShader(LayerQuadMaskVS,
> + sizeof(LayerQuadMaskVS),
> + nullptr,
> + byRef(mAttachments->mVSQuadShader[Mask2d]));
A line like this is a great idea to break up! And I consider it a failure I didn't do so myself :-)
@@ +803,5 @@
> {
> nsRefPtr<ID3D11Texture2D> backBuf;
>
> + mSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D),
> + (void**)backBuf.StartAssignment());
A line like this is not, in my opinion.
Attachment #776960 -
Flags: review?(bas) → review-
Comment 14•11 years ago
|
||
I should note I realize our style guide says 80 characters for most code (I think js/ uses 100). I think that's something we should discuss, I realize that strictly speaking your changes are correct.
Assignee | ||
Comment 15•11 years ago
|
||
Assignee: bas → ncameron
Attachment #777347 -
Flags: review?
Assignee | ||
Updated•11 years ago
|
Attachment #777347 -
Flags: review? → review?(bas)
Comment 16•11 years ago
|
||
Comment on attachment 777347 [details] [diff] [review]
Implement CreateRenderTargetFromSource
Review of attachment 777347 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/layers/d3d11/CompositorD3D11.cpp
@@ +387,5 @@
>
> RefPtr<ID3D11Texture2D> texture;
> + mDevice->CreateTexture2D(&desc, nullptr, byRef(texture));
> +
> + if (aSource) {
We should add some bounds checking here, out of bounds CopySubresourceRegion's can cause driver crashes on some buggy drivers.
::: gfx/layers/d3d11/TextureD3D11.cpp
@@ +45,5 @@
>
> mTextures[0] = aTexture;
>
> RefPtr<ID3D11Device> device;
> mTextures[0]->GetDevice(byRef(device));
Meh, we waste a GetDevice here now, but then again, who cares.
Attachment #777347 -
Flags: review?(bas) → review+
Comment 17•11 years ago
|
||
Is there a bug for D3D10 too?
Assignee | ||
Comment 18•11 years ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #17)
> Is there a bug for D3D10 too?
No, we are only using d3d11 for OMTC.
Comment 19•11 years ago
|
||
(In reply to Nick Cameron [:nrc] from comment #18)
> No, we are only using d3d11 for OMTC.
There's bug 756608 for d3d9. Is that still planned?
Assignee | ||
Comment 20•11 years ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #19)
> (In reply to Nick Cameron [:nrc] from comment #18)
> > No, we are only using d3d11 for OMTC.
>
> There's bug 756608 for d3d9. Is that still planned?
Yes, it's almost done actually, just ironing out a bug or two.
Assignee | ||
Comment 21•11 years ago
|
||
(In reply to Bas Schouten (:bas.schouten) from comment #14)
> I should note I realize our style guide says 80 characters for most code (I
> think js/ uses 100). I think that's something we should discuss, I realize
> that strictly speaking your changes are correct.
I think there is some scope for having 'local style', although I think that is intended for old stuff rather than new stuff. We have not been too strict about the 80 char limit in gfx, but some modules (e.g., layout are). I kind of like the 80 char limit because it makes it easy to have two files side by side, but I agree we should not be too strict about it.
Anyway, I prefer to have a soft 80 char limit than to have a hard 100 char limit. I'll adjust the formatting to be have more overruns.
Assignee | ||
Comment 22•11 years ago
|
||
(In reply to Bas Schouten (:bas.schouten) from comment #12)
> (In reply to Bas Schouten (:bas.schouten) from comment #11)
> > Comment on attachment 776960 [details] [diff] [review]
> > formatting - getting my ocd on
> >
> > Review of attachment 776960 [details] [diff] [review]:
> > -----------------------------------------------------------------
> >
> > Can we only break lines which are over 100 characters? I find a lot of these
> > changes disastrously ugly.
> >
> > ::: gfx/layers/d3d11/CompositorD3D11.cpp
> > @@ +56,5 @@
> > > RefPtr<ID3D11BlendState> mPremulBlendState;
> > > RefPtr<ID3D11BlendState> mNonPremulBlendState;
> > > };
> > >
> > > +CompositorD3D11::CompositorD3D11(nsIWidget* aWidget)
> >
> > I actually prefer the other style. I don't think our style guide offers any
> > hints here so I guess we'll have to fight to the death :-).
>
> Wait, somebody with no sense of style whatsoever seems to have edited the
> style guide an said pointer *'s need to snuggle with the types :P. I'm going
> to try and figure out where that decision happened and whether I can fight
> them to the death instead :-).
Heh, I prefer the * being part of the type, but don't have a strong preference. The style was kind of inconsistent before though - sometimes with type sometimes with the var.
Assignee | ||
Comment 23•11 years ago
|
||
(In reply to Bas Schouten (:bas.schouten) from comment #10)
> Comment on attachment 776937 [details] [diff] [review]
> bug fix for resizing windows ugliness
>
> Review of attachment 776937 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I wonder if we can create a test for this. Very silly of me, nice catch.
Hmm, this doesn't seem to fix the Window resizing thing. But I think the fix is correct. I've not actually noticed any visual change though, so I'm not sure how to test it.
Assignee | ||
Comment 24•11 years ago
|
||
(In reply to Bas Schouten (:bas.schouten) from comment #11)
> Comment on attachment 776960 [details] [diff] [review]
> @@ +159,5 @@
> >
> > + nsIWidget* mWidget;
> > + // GetWidgetSize requires us to return a reference to an nsIntSize. Since we
> > + // don't otherwise keep this value around, we need mSize to avoid a dangling
> > + // reference problem.
>
> How about we -not- make it return a reference? :P
I'll look into it, but I'll do it as a separate patch since it is more than just formatting.
Assignee | ||
Comment 25•11 years ago
|
||
now with bounds checks, carrying r=Bas
Attachment #777347 -
Attachment is obsolete: true
Attachment #778108 -
Flags: review+
Assignee | ||
Comment 26•11 years ago
|
||
Attachment #776960 -
Attachment is obsolete: true
Attachment #778128 -
Flags: review?(bas)
Assignee | ||
Comment 27•11 years ago
|
||
Attachment #778129 -
Flags: review?(bas)
Assignee | ||
Comment 28•11 years ago
|
||
We choke on this further down in Moz2D (call to CreateSharedBitmap) but it was hard to detect and fallback there so added the check here.
Updated•11 years ago
|
Attachment #778128 -
Flags: review?(bas) → review+
Comment 29•11 years ago
|
||
Comment on attachment 778129 [details] [diff] [review]
LockDrawTarget for shmem texture clients
Review of attachment 778129 [details] [diff] [review]:
-----------------------------------------------------------------
This is in general a great move! :)
::: gfx/layers/client/TextureClient.cpp
@@ +128,5 @@
> + return mDrawTarget;
> + }
> +
> + gfxASurface* surface = GetSurface();
> + mDrawTarget = gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surface, mSize);
Could we remove the dependency on Thebes and create a draw target for data directly? This'll make things a lot easier when we want to get rid of thebes.
Attachment #778129 -
Flags: review?(bas) → review-
Assignee | ||
Updated•11 years ago
|
Attachment #778135 -
Flags: review?(bas)
Assignee | ||
Updated•11 years ago
|
Attachment #771137 -
Flags: checkin+
Assignee | ||
Updated•11 years ago
|
Attachment #776937 -
Flags: checkin+
Assignee | ||
Updated•11 years ago
|
Attachment #778108 -
Flags: checkin+
Assignee | ||
Updated•11 years ago
|
Attachment #778128 -
Flags: checkin+
Assignee | ||
Comment 30•11 years ago
|
||
Comment 31•11 years ago
|
||
Assignee | ||
Comment 32•11 years ago
|
||
Comment on attachment 778129 [details] [diff] [review]
LockDrawTarget for shmem texture clients
(In reply to Bas Schouten (:bas.schouten) from comment #29)
> Comment on attachment 778129 [details] [diff] [review]
> LockDrawTarget for shmem texture clients
>
> Review of attachment 778129 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> This is in general a great move! :)
>
> ::: gfx/layers/client/TextureClient.cpp
> @@ +128,5 @@
> > + return mDrawTarget;
> > + }
> > +
> > + gfxASurface* surface = GetSurface();
> > + mDrawTarget = gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surface, mSize);
>
> Could we remove the dependency on Thebes and create a draw target for data
> directly? This'll make things a lot easier when we want to get rid of thebes.
That's actually pretty tricky because it means being able to open shmems as Azure DrawTargets rather than Thebes surfaces (and probably add methods for opening SurfaceDescriptors as DrawTargets). Which is not impossible, but more than I really want to get involved in for this. Just opening SurfaceDescriptors as DrawTargets but leaving the shmem stuff essentially means just wrapping the Thebes surface, but at a lower level.
Attachment #778129 -
Flags: review- → review?(bas)
Updated•11 years ago
|
Attachment #778135 -
Flags: review?(bas) → review+
Comment 33•11 years ago
|
||
Comment on attachment 778129 [details] [diff] [review]
LockDrawTarget for shmem texture clients
Review of attachment 778129 [details] [diff] [review]:
-----------------------------------------------------------------
Hrm, we'll want to do that eventually I suppose, but maybe now is not the time!
Attachment #778129 -
Flags: review?(bas) → review+
Assignee | ||
Comment 34•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #778129 -
Flags: checkin+
Assignee | ||
Updated•11 years ago
|
Attachment #778135 -
Flags: checkin+
Comment 35•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Comment 36•11 years ago
|
||
How do I force Direct3D 11 OMTC for testing purposes in Nightly? It seems to be ignoring the force Direct2D option in about:config. The same option works fine with OMTC disabled.
In Firefox 24, I have the opposite problem, in that D3D11 OMTC works even if I force disable Direct2D. So, while something's changed between now and then, forcing on or off D2D seems to be being ignored.
BTW, the content renderer seems to have improved so that the black box problem (on some older graphics cards) is no longer present there--although it's still present in Direct2D layers and canvas--hence why I wish to test the D3D11 OMTC.
Note that about:support still shows the Direct2D content renderer as working even though it says I'm in D3D9 OMTC.
Comment 37•11 years ago
|
||
(In reply to Terrell Kelley from comment #36)
> How do I force Direct3D 11 OMTC for testing purposes in Nightly? It seems to
> be ignoring the force Direct2D option in about:config. The same option works
> fine with OMTC disabled.
I set the following to true in about:config
layers.acceleration.force-enabled
layers.offmainthreadcomposition.enabled
layers.offmainthreadcomposition.animate-opacity
layers.offmainthreadcomposition.animate-transform
layers.async-video.enabled
about:support now shows 1/1 Direct3D 11 (OMTC).
Comment 38•11 years ago
|
||
(In reply to Brian Carpenter [:geeknik] from comment #37)
> I set the following to true in about:config
>
> layers.acceleration.force-enabled
> layers.offmainthreadcomposition.enabled
> layers.offmainthreadcomposition.animate-opacity
> layers.offmainthreadcomposition.animate-transform
> layers.async-video.enabled
>
> about:support now shows 1/1 Direct3D 11 (OMTC).
Adding those I hadn't already tried got Direct2D in content and canvas, but layers still says "Direct3D 9 (OTMC)." My guess is that gfx.direct2d.force-enabled is being ignored by Layers when OTMC is on. But I didn't want to file a bug until I knew I wasn't doing something stupid.
Comment 39•11 years ago
|
||
I've now filed bug 927405 about this.
Assignee | ||
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Target Milestone: --- → mozilla28
Comment 40•11 years ago
|
||
I verified that 1/1 Direct3D 11 (OMTC) is activated on Windows 8.1, Windows 7 and Windows Vista. And did some exploratory on some websites: https://etherpad.mozilla.org/firefox-Direct3D11-OMTC
Dropping verifyme since Direct3D 11 is activated.
On a particular website I encountered a black rendering issue. This only happens if 'layers.offmainthreadcomposition.enabled' is enabled. Reproduced on all OS`s from above using Firefox 28beta, Aurora and Nightly.
Screencast: http://www.screencast.com/t/VqP9UsR7
Should I log a new issue on that?
Flags: needinfo?(ncameron)
Keywords: verifyme
Comment 41•11 years ago
|
||
Yes please, and make it block bug 899785 which is to turn OMTC DX11 on by default.
Flags: needinfo?(ncameron)
Comment 42•11 years ago
|
||
Thanks Milan, I logged bug 977520 for that.
Comment 43•11 years ago
|
||
Calling this verified based on comment 40.
Given the scope, should this get the feature keyword and/or relnoted?
Status: RESOLVED → VERIFIED
status-firefox28:
--- → verified
Flags: needinfo?(release-mgmt)
QA Contact: bogdan.maris
Comment 44•11 years ago
|
||
Putting ni? on myself to come back and check on this - but can someone summarize what the note should tell the user about this change?
Flags: needinfo?(release-mgmt) → needinfo?(lsblakk)
Comment 45•11 years ago
|
||
This is a trick bug - OMTC D3D11 is implemented, but off by default. On by default shows up in bug 899785. If we want to release note this, it should be "if you enable this option, then... and you may notice some performance degradation in...". Let me know if that's the case and I can get you the text for the two ... places.
Comment 46•11 years ago
|
||
(In reply to Milan Sreckovic [:milan] from comment #45)
> This is a trick bug - OMTC D3D11 is implemented, but off by default. On by
> default shows up in bug 899785. If we want to release note this, it should
> be "if you enable this option, then... and you may notice some performance
> degradation in...". Let me know if that's the case and I can get you the
> text for the two ... places.
Ah. In that case, no note needed - we will not note something the user would have to manually enable.
Flags: needinfo?(lsblakk)
You need to log in
before you can comment on or make changes to this bug.
Description
•