Cut down on compositor spam after a device reset. (bug 1363126 part 5, r=rhunt)

This commit is contained in:
David Anderson 2017-05-11 22:44:28 -07:00
Родитель 1118ca109b
Коммит b76228bd31
3 изменённых файлов: 19 добавлений и 7 удалений

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

@ -976,16 +976,19 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
}
if (mDevice->GetDeviceRemovedReason() != S_OK) {
gfxCriticalNote << "GFX: D3D11 skip BeginFrame with device-removed.";
ReadUnlockTextures();
*aRenderBoundsOut = IntRect();
// If we are in the GPU process then the main process doesn't
// know that a device reset has happened and needs to be informed
if (XRE_IsGPUProcess()) {
GPUParent::GetSingleton()->NotifyDeviceReset();
}
if (!mAttachments->IsDeviceReset()) {
gfxCriticalNote << "GFX: D3D11 skip BeginFrame with device-removed.";
// If we are in the GPU process then the main process doesn't
// know that a device reset has happened and needs to be informed
if (XRE_IsGPUProcess()) {
GPUParent::GetSingleton()->NotifyDeviceReset();
}
mAttachments->SetDeviceReset();
}
return;
}

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

@ -22,7 +22,8 @@ DeviceAttachmentsD3D11::DeviceAttachmentsD3D11(ID3D11Device* device)
mMaximumTriangles(kInitialMaximumTriangles),
mDevice(device),
mContinueInit(true),
mInitialized(false)
mInitialized(false),
mDeviceReset(false)
{
}

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

@ -73,6 +73,13 @@ public:
RefPtr<IDXGIResource> mSyncTexture;
HANDLE mSyncHandle;
void SetDeviceReset() {
mDeviceReset = true;
}
bool IsDeviceReset() const {
return mDeviceReset;
}
private:
explicit DeviceAttachmentsD3D11(ID3D11Device* device);
~DeviceAttachmentsD3D11();
@ -100,6 +107,7 @@ private:
RefPtr<ID3D11Device> mDevice;
bool mContinueInit;
bool mInitialized;
bool mDeviceReset;
nsCString mInitFailureId;
};