mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1459233 - Make SyncObjectD3D11Host::Synchronize() fallible with WebRender r=mattwoodrow
This commit is contained in:
parent
8bf0b5f63b
commit
c4eb825654
@ -37,7 +37,7 @@ public:
|
||||
virtual SyncHandle GetSyncHandle() = 0;
|
||||
|
||||
// Return false for failed synchronization.
|
||||
virtual bool Synchronize() = 0;
|
||||
virtual bool Synchronize(bool aFallible = false) = 0;
|
||||
|
||||
protected:
|
||||
SyncObjectHost() { }
|
||||
|
@ -1716,22 +1716,24 @@ SyncObjectD3D11Host::GetSyncHandle()
|
||||
}
|
||||
|
||||
bool
|
||||
SyncObjectD3D11Host::Synchronize()
|
||||
SyncObjectD3D11Host::Synchronize(bool aFallible)
|
||||
{
|
||||
HRESULT hr;
|
||||
AutoTextureLock lock(mKeyedMutex, hr, 10000);
|
||||
|
||||
if (hr == WAIT_TIMEOUT) {
|
||||
hr = mDevice->GetDeviceRemovedReason();
|
||||
if (hr == S_OK) {
|
||||
if (hr != S_OK ) {
|
||||
// Since the timeout is related to the driver-removed. Return false for
|
||||
// error handling.
|
||||
gfxCriticalNote << "GFX: D3D11 timeout with device-removed:" << gfx::hexa(hr);
|
||||
} else if (aFallible) {
|
||||
gfxCriticalNote << "GFX: D3D11 timeout on the D3D11 sync lock.";
|
||||
} else {
|
||||
// There is no driver-removed event. Crash with this timeout.
|
||||
MOZ_CRASH("GFX: D3D11 normal status timeout");
|
||||
}
|
||||
|
||||
// Since the timeout is related to the driver-removed. Return false for
|
||||
// error handling.
|
||||
gfxCriticalNote << "GFX: D3D11 timeout with device-removed:" << gfx::hexa(hr);
|
||||
|
||||
return false;
|
||||
}
|
||||
if (hr == WAIT_ABANDONED) {
|
||||
|
@ -498,7 +498,7 @@ public:
|
||||
|
||||
virtual SyncHandle GetSyncHandle() override;
|
||||
|
||||
virtual bool Synchronize() override;
|
||||
virtual bool Synchronize(bool aFallible) override;
|
||||
|
||||
IDXGIKeyedMutex* GetKeyedMutex() { return mKeyedMutex.get(); };
|
||||
|
||||
|
@ -311,7 +311,7 @@ RenderCompositorANGLE::BeginFrame()
|
||||
}
|
||||
|
||||
if (mSyncObject) {
|
||||
if (!mSyncObject->Synchronize()) {
|
||||
if (!mSyncObject->Synchronize(/* aFallible */ true)) {
|
||||
// It's timeout or other error. Handle the device-reset here.
|
||||
RenderThread::Get()->HandleDeviceReset("SyncObject", /* aNotify */ true);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user