Bug 1749183 - Fix RenderThread::HandleDeviceReset() for simulate device reset r=gfx-reviewers,aosmond

Current RenderThread::HandleDeviceReset() does nothing for simulate device reset.

Differential Revision: https://phabricator.services.mozilla.com/D135590
This commit is contained in:
sotaro 2022-01-20 00:22:36 +00:00
Родитель c1b142f453
Коммит 54e275e8ad
1 изменённых файлов: 15 добавлений и 0 удалений

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

@ -867,7 +867,22 @@ static DeviceResetReason GLenumToResetReason(GLenum aReason) {
void RenderThread::HandleDeviceReset(const char* aWhere, GLenum aReason) { void RenderThread::HandleDeviceReset(const char* aWhere, GLenum aReason) {
MOZ_ASSERT(IsInRenderThread()); MOZ_ASSERT(IsInRenderThread());
// This happens only on simulate device reset.
if (aReason == LOCAL_GL_NO_ERROR) { if (aReason == LOCAL_GL_NO_ERROR) {
MOZ_ASSERT(XRE_IsGPUProcess());
if (!mHandlingDeviceReset) {
mHandlingDeviceReset = true;
MutexAutoLock lock(mRenderTextureMapLock);
mRenderTexturesDeferred.clear();
for (const auto& entry : mRenderTextures) {
entry.second->ClearCachedResources();
}
// Simulate DeviceReset does not need to notify the device reset to
// GPUProcessManager. It is already done by
// GPUProcessManager::SimulateDeviceReset().
}
return; return;
} }