Closed Bug 1176446 Opened 9 years ago Closed 9 years ago

TextureClientD3D11 should take into account the layer backend when allocating a surface

Categories

(Core :: Graphics, defect)

All
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: mchang, Assigned: mchang)

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file, 1 obsolete file)

See https://bugzilla.mozilla.org/show_bug.cgi?id=1155828#c39

Essentially, the TextureClient can create a d3d 11 surface. Whenever a caller calls BorrowDrawTarget(), it will get a d3d 11 draw target even if the backend is d2d 1.0. This can create large performance penalties on nvidia GPUs. The TextureClient should allocate a surface based on the backend as well so it meshes well with DrawTargets created by CreateOffscreenContentDrawTarget.
Summary: TextureClientD3D11 should allocate a surface based on the layer backend as well → TextureClientD3D11 should take into account the layer backend when allocating a surface
Comment on attachment 8624988 [details] [diff] [review]
Only alloc d3d11 device texture if we have a d3d11 backend

Review of attachment 8624988 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/d3d11/TextureD3D11.cpp
@@ +453,2 @@
>  
> +  if (gfxPrefs::Direct2DUse1_1() && d3d11device && haveD3d11Backend) {

I think we can skip the gfxPrefs check here (BackendType::DIRECT2D1_1 is only added to the 'allowed' list if this pref is true), and just assert that d3d11device is != nullptr if haveD3D11Backend is true.
Attachment #8624988 - Flags: review?(jmuizelaar) → review?(bas)
Comment on attachment 8624988 [details] [diff] [review]
Only alloc d3d11 device texture if we have a d3d11 backend

Review of attachment 8624988 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/d3d11/TextureD3D11.cpp
@@ +453,2 @@
>  
> +  if (gfxPrefs::Direct2DUse1_1() && d3d11device && haveD3d11Backend) {

I believe what Matt said is correct.
Attachment #8624988 - Flags: review?(bas) → review+
Carrying r+, updated with Matt's feedback from comment 2.
Attachment #8624988 - Attachment is obsolete: true
Attachment #8625508 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/7085b1090e92
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: