зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1271657. Redo gfxConfig support for HW D3D11 ANGLE. r=dvander
This commit is contained in:
Родитель
01d029f0e7
Коммит
2418bd8394
|
@ -20,7 +20,7 @@ namespace gfx {
|
|||
_(D3D11_COMPOSITING, Feature, "Direct3D11 Compositing") \
|
||||
_(D3D9_COMPOSITING, Feature, "Direct3D9 Compositing") \
|
||||
_(DIRECT2D, Feature, "Direct2D") \
|
||||
_(D3D11_ANGLE, Feature, "Direct3D11 ANGLE") \
|
||||
_(D3D11_HW_ANGLE, Feature, "Direct3D11 hardware ANGLE") \
|
||||
/* Add new entries above this comment */
|
||||
|
||||
enum class Feature : uint32_t {
|
||||
|
|
|
@ -170,7 +170,7 @@ GetAndInitDisplayForAccelANGLE(GLLibraryEGL& egl)
|
|||
{
|
||||
EGLDisplay ret = 0;
|
||||
|
||||
FeatureState& d3d11ANGLE = gfxConfig::GetFeature(Feature::D3D11_ANGLE);
|
||||
FeatureState& d3d11ANGLE = gfxConfig::GetFeature(Feature::D3D11_HW_ANGLE);
|
||||
|
||||
if (!gfxPrefs::WebGLANGLETryD3D11())
|
||||
d3d11ANGLE.UserDisable("User disabled D3D11 ANGLE by pref");
|
||||
|
@ -178,7 +178,7 @@ GetAndInitDisplayForAccelANGLE(GLLibraryEGL& egl)
|
|||
if (gfxPrefs::WebGLANGLEForceD3D11())
|
||||
d3d11ANGLE.UserForceEnable("User force-enabled D3D11 ANGLE on disabled hardware");
|
||||
|
||||
if (gfxConfig::IsForcedOnByUser(Feature::D3D11_ANGLE))
|
||||
if (gfxConfig::IsForcedOnByUser(Feature::D3D11_HW_ANGLE))
|
||||
return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE);
|
||||
|
||||
if (d3d11ANGLE.IsEnabled()) {
|
||||
|
|
|
@ -2067,7 +2067,6 @@ gfxPlatform::OptimalFormatForContent(gfxContentType aContent)
|
|||
* and remember the values. Changing these preferences during the run will
|
||||
* not have any effect until we restart.
|
||||
*/
|
||||
bool gANGLESupportsD3D11 = false;
|
||||
static mozilla::Atomic<bool> sLayersSupportsHardwareVideoDecoding(false);
|
||||
static bool sLayersHardwareVideoDecodingFailed = false;
|
||||
static bool sBufferRotationCheckPref = true;
|
||||
|
@ -2096,15 +2095,6 @@ gfxPlatform::InitAcceleration()
|
|||
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
|
||||
nsCString discardFailureId;
|
||||
int32_t status;
|
||||
#ifdef XP_WIN
|
||||
if (!gfxPrefs::LayersAccelerationDisabledDoNotUseDirectly() && gfxInfo) {
|
||||
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE, discardFailureId, &status))) {
|
||||
if (status == nsIGfxInfo::FEATURE_STATUS_OK) {
|
||||
gANGLESupportsD3D11 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Preferences::GetBool("media.hardware-video-decoding.enabled", false) &&
|
||||
#ifdef XP_WIN
|
||||
|
|
|
@ -373,6 +373,14 @@ gfxWindowsPlatform::~gfxWindowsPlatform()
|
|||
CoUninitialize();
|
||||
}
|
||||
|
||||
static void
|
||||
UpdateANGLEConfig()
|
||||
{
|
||||
if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
|
||||
gfxConfig::Disable(Feature::D3D11_HW_ANGLE, FeatureStatus::Disabled, "D3D11 compositing is disabled");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gfxWindowsPlatform::InitAcceleration()
|
||||
{
|
||||
|
@ -389,6 +397,7 @@ gfxWindowsPlatform::InitAcceleration()
|
|||
|
||||
InitializeConfig();
|
||||
InitializeDevices();
|
||||
UpdateANGLEConfig();
|
||||
UpdateRenderMode();
|
||||
}
|
||||
|
||||
|
@ -460,6 +469,7 @@ gfxWindowsPlatform::HandleDeviceReset()
|
|||
gfxAlphaBoxBlur::ShutdownBlurCache();
|
||||
|
||||
InitializeDevices();
|
||||
UpdateANGLEConfig();
|
||||
BumpDeviceCounter();
|
||||
return true;
|
||||
}
|
||||
|
@ -1920,6 +1930,25 @@ IsWARPStable()
|
|||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
InitializeANGLEConfig()
|
||||
{
|
||||
FeatureState& d3d11ANGLE = gfxConfig::GetFeature(Feature::D3D11_HW_ANGLE);
|
||||
|
||||
if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
|
||||
d3d11ANGLE.DisableByDefault(FeatureStatus::Unavailable, "D3D11 compositing is disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
d3d11ANGLE.EnableByDefault();
|
||||
|
||||
nsCString message;
|
||||
if (!IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE, &message)) {
|
||||
d3d11ANGLE.Disable(FeatureStatus::Blacklisted, message.get());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
gfxWindowsPlatform::InitializeConfig()
|
||||
{
|
||||
|
@ -1930,6 +1959,7 @@ gfxWindowsPlatform::InitializeConfig()
|
|||
|
||||
InitializeD3D9Config();
|
||||
InitializeD3D11Config();
|
||||
InitializeANGLEConfig();
|
||||
InitializeD2DConfig();
|
||||
}
|
||||
|
||||
|
@ -2033,6 +2063,9 @@ gfxWindowsPlatform::UpdateDeviceInitData()
|
|||
FeatureStatus::Disabled,
|
||||
"Disabled by parent process");
|
||||
|
||||
|
||||
InitializeANGLEConfig();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2097,13 +2130,13 @@ gfxWindowsPlatform::AttemptD3D11DeviceCreation(FeatureState& d3d11)
|
|||
mCompositorD3D11TextureSharingWorks = ::DoesD3D11TextureSharingWork(mD3D11Device);
|
||||
|
||||
if (!mCompositorD3D11TextureSharingWorks) {
|
||||
gfxConfig::SetFailed(Feature::D3D11_ANGLE,
|
||||
gfxConfig::SetFailed(Feature::D3D11_HW_ANGLE,
|
||||
FeatureStatus::Broken,
|
||||
"Texture sharing doesn't work");
|
||||
}
|
||||
|
||||
if (DoesRenderTargetViewNeedsRecreating(mD3D11Device)) {
|
||||
gfxConfig::SetFailed(Feature::D3D11_ANGLE,
|
||||
gfxConfig::SetFailed(Feature::D3D11_HW_ANGLE,
|
||||
FeatureStatus::Broken,
|
||||
"RenderTargetViews need recreating");
|
||||
}
|
||||
|
@ -2352,12 +2385,6 @@ gfxWindowsPlatform::InitializeDevices()
|
|||
InitializeD3D11();
|
||||
InitializeD2D();
|
||||
|
||||
if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
|
||||
gfxConfig::DisableByDefault(Feature::D3D11_ANGLE, FeatureStatus::Disabled, "D3D11 compositing is disabled");
|
||||
} else {
|
||||
gfxConfig::EnableByDefault(Feature::D3D11_ANGLE);
|
||||
}
|
||||
|
||||
if (!gfxConfig::IsEnabled(Feature::DIRECT2D)) {
|
||||
if (XRE_IsContentProcess() && GetParentDevicePrefs().useD2D1()) {
|
||||
RecordContentDeviceFailure(TelemetryDeviceCode::D2D1);
|
||||
|
|
Загрузка…
Ссылка в новой задаче