Closed Bug 927405 Opened 11 years ago Closed 11 years ago

Direct3D 11 OTMC is not initializing on Nvidia 7600 GS

Categories

(Core :: Graphics: Layers, defect)

28 Branch
x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: terrell.kelley, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130915200815

Steps to reproduce:

I enabled OTMC, and attempted to force on Direct2D (and thus Direct3D 11 OTMC). I've trired all of the following settings.

gfx.direct2d.force-enabled
layers.acceleration.force-enabled
layers.offmainthreadcomposition.enabled
layers.offmainthreadcomposition.animate-opacity
layers.offmainthreadcomposition.animate-transform
layers.offmainthreadcomposition.testing.enabled
layers.async-video.enabled


Actual results:

about:support still says I'm using Direct3D9 OTMC. Both Azure backends (canvas and content) were running in Direct2D mode.


Expected results:

I should be using Direct3D11 OTMC, and about:support should say so.

EXTRA INFORMATION: 

The exact opposite happens in Firefox 24. I am unable to force D3D9 OTMC, even with layers.prefer-d3d9 set.
Thanks for filing this bug. I haven't been able to look into it yet due to travel and some high priority things, but I'll do my best to get to it soon.
(In reply to Terrell Kelley from comment #0)
> gfx.direct2d.force-enabled

You shouldn't need this - direct2d should be on by default. If it is not, then you might have driver issues.

> layers.acceleration.force-enabled

You don't need this pref on Windows.

> layers.offmainthreadcomposition.enabled

Turns on OMTC

> layers.offmainthreadcomposition.animate-opacity
> layers.offmainthreadcomposition.animate-transform
> layers.offmainthreadcomposition.testing.enabled
> layers.async-video.enabled

You should not use any of these four prefs

There is also a pref which disables d2d - gfx.direct2d.disabled, could you check that is is set to false?

> 
> 
> Actual results:
> 
> about:support still says I'm using Direct3D9 OTMC. Both Azure backends
> (canvas and content) were running in Direct2D mode.
> 

Could you copy your about:support page to the please?

> 
> Expected results:
> 
> I should be using Direct3D11 OTMC, and about:support should say so.
> 
> EXTRA INFORMATION: 
> 
> The exact opposite happens in Firefox 24. I am unable to force D3D9 OTMC,
> even with layers.prefer-d3d9 set.

I'm not sure off the top of my head, but 24 is probably too old to support d3d9 omtc.
Like I said in my previous response on the Direct3D 9 renderer, my card is blacklisted for Direct2D (even with the latest driver), and for good reason. The Firefox 24 renderers put black boxes on all fonts. Only the new Azure content renderer in Nightly seems to fix this (and it's still messed up on canvas). And Direct3D 11 OMTC works on Firefox 24, without any black boxes. (It just has scrolling bugs that make it unusable.)

I'll send you my about:support info, but I'm not sure it's as relevant as you think. The bug I'm reporting is that, even if Direct2D is blacklisted on my card, I should be able to force on Direct2D and thus force on Direct3D 11 OMTC. That's the point of having the gfx.direct2d.force-enabled pref. 

As you can guess, I'm testing to see if changes in the Direct2D renderer will support my card, as it seems you are making progress towards such support. And I have to be able to override the blacklist to do that testing.

about:support Graphics info (starting from a blank profile, with just the OMTC and force Direct2d prefs enabled):

Adapter Description          	NVIDIA GeForce 7600 GS
Adapter Drivers           	nvd3dum
Adapter RAM               	512
ClearType Parameters         	Gamma: 2300 Pixel Structure: RGB
Device ID                   	0x02e1
Direct2D Enabled         	true
DirectWrite Enabled            	true (6.2.9200.16571)
Driver Date	                1-31-2013
Driver Version           	9.18.13.783
GPU #2 Active          	        false
GPU Accelerated Windows   	1/1 Direct3D 9 (OMTC)
Vendor ID        	        0x10de
WebGL Renderer          	Google Inc. -- ANGLE (NVIDIA GeForce 7600 GS Direct3D9Ex vs_3_0 ps_3_0)
windowLayerManagerRemote        true
AzureCanvasBackend 	        direct2d
AzureContentBackend 	        direct2d
AzureFallbackCanvasBackend	cairo
AzureSkiaAccelerated       	0

And here are my "Important changed prefs" just to be sure:

browser.cache.disk.capacity                       	358400
browser.cache.disk.smart_size_cached_value      	358400
browser.cache.disk.smart_size.first_run	                false
browser.cache.disk.smart_size.use_old_max       	false
browser.places.smartBookmarksVersion	                4
browser.sessionstore.upgradeBackup.latestBuildID	20131016030202
browser.startup.homepage_override.buildID	        20131016030202
browser.startup.homepage_override.mstone        	27.0a1
dom.mozApps.used                                	true
extensions.lastAppVersion                       	27.0a1
gfx.direct2d.force-enabled                      	true
layers.offmainthreadcomposition.enabled            	true
network.cookie.prefsMigrated                     	true
places.database.lastMaintenance	                        1383094371
places.history.expiration.transient_current_max_pages	26819
plugin.disable_full_page_plugin_for_types       	application/pdf
plugin.importedState                               	true
privacy.sanitize.migrateFx3Prefs                  	true
storage.vacuum.last.index                       	0
storage.vacuum.last.places.sqlite                   	1381940186
So, given the about:support page and some code reading, I'm pretty sure enabling d2d is not the issue - that is, it looks like d2d is being initialised (possibly even used. I expect CompositorD3D11::Initialize is failing and thus we fall back to d3d9, but there are a number of reasons that can happen. We do not check for d2d or any of the d2d prefs there.

Are you able to run Firefox under a debugger to step through CompositorD3D11::Initialize and identify where we are failing? If not I can produce a Firefox build with some logging to identify the failure.
Flags: needinfo?(terrell.kelley)
I am not. I would need the build you mention.
Flags: needinfo?(terrell.kelley)
Summary: Layers OMTC is ignoring gfx.direct2d.force-enabled → Direct3D 11 OTMC is not initializing on Nvidia 7600 GS
Version: 27 Branch → 28 Branch
Just leaving this here for posterity.
The build is here: http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/ncameron@mozilla.com-a97b606f7926/try-win32/firefox-28.0a1.en-US.win32.installer.exe

The log output should end up in stdout - in the console if you run firefox there. All the interesting output should begin with "[nrc".

Could you try running this build, confirm it has the same issues, and copy the log here please?
Flags: needinfo?(terrell.kelley)
(In reply to Nick Cameron [:nrc] from comment #8)
> Could you try running this build, confirm it has the same issues, and copy
> the log here please?

Sure.

[nrc gfxWindowsPlatform::GetDXGIAdapter] returning adapter ca1578
[nrc gfxWindowsPlatform::GetDXGIAdapter] returning cached adapter ca1578
[nrc gfxWindowsPlatform::GetD3D11Device] returning device c838c4
[nrc CompositorD3D11::Initialize] CreateBlendState (3) failed
[nrc gfxWindowsPlatform::GetD3D11Device] returning cached device c838c4
[nrc CompositorD3D11::Initialize] CreateBlendState (3) failed
[nrc gfxWindowsPlatform::GetD3D11Device] returning cached device c838c4
[nrc CompositorD3D11::Initialize] CreateBlendState (3) failed

And, no, alpha was not a problem on Firefox 24 where D3D11 OMTC seems to work. I'll be happy to regression test, BTW.
Flags: needinfo?(terrell.kelley)
Could you try setting the 'layers.componentalpha.enabled' to false please? That ought to solve the problem, but at the expense of losing subpixel AA in some places.
I wonder if your driver/card does not support dual-source blending. That was added to our compositor kind of recently and is the only change to the initialisation code.
(In reply to Nick Cameron [:nrc] from comment #11)
> I wonder if your driver/card does not support dual-source blending. That was
> added to our compositor kind of recently and is the only change to the
> initialisation code.

Given that it is an old card and the d2d issues, that seems the most likely.
(In reply to Nick Cameron [:nrc] from comment #10)
> Could you try setting the 'layers.componentalpha.enabled' to false please?
> That ought to solve the problem, but at the expense of losing subpixel AA in
> some places.

Yip. That was it. I am now running in D3D11 OMTC. Any chance at using that granular a blacklist?

You say I will loose subpixel AA in "some places." In what places are these? Not in fonts, right? And there doesn't happen to be a similar setting for Azure, does there?

Also, loving the conversation with yourself. :)
BTW, it also works with D2D shut off.

> And there doesn't happen to be a similar setting for Azure, does there?

When I say Azure, I mean Azure canvas. Azure content acceleration is working (at least, for D2D and Cairo. Skia can't be turned on unless D2D is off. I assume that has to do with problems with DirectWrite.)
(In reply to Terrell Kelley from comment #13)
> (In reply to Nick Cameron [:nrc] from comment #10)
> > Could you try setting the 'layers.componentalpha.enabled' to false please?
> > That ought to solve the problem, but at the expense of losing subpixel AA in
> > some places.
> 
> Yip. That was it. I am now running in D3D11 OMTC. Any chance at using that
> granular a blacklist?
> 

I doubt it. Our blacklist is not super sophisticated and given the other problems you report with d2d it's unlikely it would be useful for very many users.

> You say I will loose subpixel AA in "some places." In what places are these?
> Not in fonts, right? And there doesn't happen to be a similar setting for
> Azure, does there?
> 

We only use subpixel AA for fonts. You will lose it where we would have to use a component alpha surface - that happens when we cannot draw all 'layers' (I'm using scare quotes here because I don't necessarily mean a |Layer| object) to the screen in one go. The common situation where this occurs is where you have text on a transparent or semi-transparent 'layer' with something underneath and we cannot flatten the two 'layers' together for rendering. That is kind of rare, but not as rare as you might think. You hopefully shouldn't notice having no subpixel AA sometimes - it is the default configuration on mobile.

> Also, loving the conversation with yourself. :)

:-)

(Resolving as invalid because there is no 'bug' as such - the issue is due to old hardware and overriding default prefs)
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
(In reply to Terrell Kelley from comment #14)
> BTW, it also works with D2D shut off.
> 
> > And there doesn't happen to be a similar setting for Azure, does there?
> 
> When I say Azure, I mean Azure canvas. Azure content acceleration is working
> (at least, for D2D and Cairo. Skia can't be turned on unless D2D is off. I
> assume that has to do with problems with DirectWrite.)

You are correct that Skia and DirectWrite do not play well together, which means you can't use Skia with D2D. Given that D2D initialises correctly you ought to be able to use the D2D backend for canvas.
(In reply to Nick Cameron [:nrc] from comment #16)

> You are correct that Skia and DirectWrite do not play well together, which
> means you can't use Skia with D2D. Given that D2D initialises correctly you
> ought to be able to use the D2D backend for canvas.

I can use it, but it still has the font rendering problem (black boxes). Both content  and D2D layers seem to have been refactored to no longer have this problem, so I'm hoping it can also be fixed on canvas. Content and layers accelerate well, and there doesn't seem to be a way to have them on but shut off accelerated canvas.

I would like to have D2D enabled, as I think GDI fonts look horrible, and prefing on DirectWrite has some weird "pop-in" issues where the text renders but antialiased text only pops in later (mostly visible in rich-text boxes). I tested this on another computer (with a compatible card), and this only happens when DirectWrite is preffed on while D2D is off.

Plus, well, it's just nice to have everything accelerated. It just feels snappier.
So, I'm not clear where the problem is now.

- Content works OK with D3D11 layers and D2D azure content backend, but with component alpha turned off, correct?
- You want to use D2D for canvas? (I assume by accelerated, you mean using D2D). So, if you set the azure canvas backend to the default ('direct2d,skia,cairo') you should get d2d and I would expect it to work (you can check in about:support).

Do you see d2d as the canvas backend in about:support?
Does it work when you use a canvas?

If either is no, then you could change the azure canvas pref to 'cairo' and cairo should use the d2d backend (but that is not reported anywhere, so you can't easily check) and performance should be almost as good as if you had d2d without the Cairo wrapping.

If the problem is that you are getting black boxes for text in canvas with d2d, then that is probably a DirectWrite problem (although that is surprising if text is OK for content). The best you can do in that case is probably the Cairo canvas backend (turning off DirectWrite is not really a good idea if it is working for content).
(In reply to Nick Cameron [:nrc] from comment #18)
> So, I'm not clear where the problem is now.
> 
> If the problem is that you are getting black boxes for text in canvas with
> d2d, then that is probably a DirectWrite problem (although that is
> surprising if text is OK for content). The best you can do in that case is
> probably the Cairo canvas backend (turning off DirectWrite is not really a
> good idea if it is working for content).

Perhaps it would be better if I just described what I see. I was just assuming it was canvas, but further testing shows that canvas works right in a lot of cases. The main problem is that right click menu shows black and gray boxes instead of text. You can see it in the attached screenshot.

This is much better than in Firefox 24, where all menus,tab titles, doorhangers, popups, etc had black boxes, as did any text put inside a button (like certain extensions do--for example, Gmail Notifier.) You can also see this in the attached screenshot.

I do not think the problem is in DirectWrite itself, as I can enable DirectWrite while Direct2D is off, and everything looks fine. In fact, this is the configuration I used on Firefox 24, as I think DirectWrite does a better job with ClearType.

Nor is this an OMTC problem. It happens whether I have that on or not. The only thing required to make it happen is Direct2D.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: