SyncObjectD3D11Host::Synchronize() calling in RenderCompositorANGLE::BeginFrame() is still necessary for D3D11DXVA2Manager::CopyToImage(). Then backout Bug 1596630.

Differential Revision: https://phabricator.services.mozilla.com/D61658

--HG--
extra : moz-landing-system : lando
This commit is contained in:
sotaro 2020-02-05 09:39:28 +00:00
Родитель d25eef6d59
Коммит aa001195aa
3 изменённых файлов: 26 добавлений и 4 удалений

Просмотреть файл

@ -449,9 +449,7 @@ D3D11TextureData* D3D11TextureData::Create(IntSize aSize, SurfaceFormat aFormat,
}
newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;
// WebRender requests keyed mutex.
if (gfxVars::UseWebRender() || !NS_IsMainThread() ||
!!(aFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT)) {
if (!NS_IsMainThread() || !!(aFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT)) {
// On the main thread we use the syncobject to handle synchronization.
if (!(aFlags & ALLOC_MANUAL_SYNCHRONIZATION)) {
newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;

Просмотреть файл

@ -227,6 +227,15 @@ bool WebRenderLayerManager::EndEmptyTransaction(EndTransactionFlags aFlags) {
refreshStart = mTransactionStart;
}
// Skip the synchronization for buffer since we also skip the painting during
// device-reset status.
if (!gfxPlatform::GetPlatform()->DidRenderingDeviceReset()) {
if (WrBridge()->GetSyncObject() &&
WrBridge()->GetSyncObject()->IsSyncObjectValid()) {
WrBridge()->GetSyncObject()->Synchronize();
}
}
GetCompositorBridgeChild()->EndCanvasTransaction();
AutoTArray<RenderRootUpdates, wr::kRenderRootCount> renderRootUpdates;
@ -404,6 +413,15 @@ void WebRenderLayerManager::EndTransactionWithoutLayer(
}
}
// Skip the synchronization for buffer since we also skip the painting during
// device-reset status.
if (!gfxPlatform::GetPlatform()->DidRenderingDeviceReset()) {
if (WrBridge()->GetSyncObject() &&
WrBridge()->GetSyncObject()->IsSyncObjectValid()) {
WrBridge()->GetSyncObject()->Synchronize();
}
}
GetCompositorBridgeChild()->EndCanvasTransaction();
{

Просмотреть файл

@ -178,7 +178,6 @@ bool RenderCompositorANGLE::Initialize() {
}
}
// SyncObject is used only by D3D11DXVA2Manager
mSyncObject = layers::SyncObjectHost::CreateSyncObjectHost(mDevice);
if (!mSyncObject->Init()) {
// Some errors occur. Clear the mSyncObject here.
@ -435,6 +434,13 @@ bool RenderCompositorANGLE::BeginFrame() {
return false;
}
if (mSyncObject) {
if (!mSyncObject->Synchronize(/* aFallible */ true)) {
// It's timeout or other error. Handle the device-reset here.
RenderThread::Get()->HandleDeviceReset("SyncObject", /* aNotify */ true);
return false;
}
}
return true;
}