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) { if (mDevice->GetDeviceRemovedReason() != S_OK) {
gfxCriticalNote << "GFX: D3D11 skip BeginFrame with device-removed.";
ReadUnlockTextures(); ReadUnlockTextures();
*aRenderBoundsOut = IntRect(); *aRenderBoundsOut = IntRect();
// If we are in the GPU process then the main process doesn't if (!mAttachments->IsDeviceReset()) {
// know that a device reset has happened and needs to be informed gfxCriticalNote << "GFX: D3D11 skip BeginFrame with device-removed.";
if (XRE_IsGPUProcess()) {
GPUParent::GetSingleton()->NotifyDeviceReset();
}
// 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; return;
} }

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

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

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

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