Add MaybeError to d3d12::Device::ExecuteCommandList

Closing a command list can fail. We need to handle the error
gracefully instead of ignoring it.

As a fallout from adding MaybeError to ExecuteCommandList, need to
also add MaybeError to TickImpl, and OnBeforePresent.

Bug:dawn:19
Change-Id: I13685f3dd731f4ab49cbff4ce4edfa960d630464
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11841
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
This commit is contained in:
Rafael Cintron
2019-10-07 15:32:10 +00:00
committed by Commit Bot service account
parent 0b82671047
commit 86d921e048
23 changed files with 60 additions and 32 deletions

View File

@@ -32,7 +32,7 @@ namespace dawn_native {
UNREACHABLE();
}
void OnBeforePresent(TextureBase* texture) override {
MaybeError OnBeforePresent(TextureBase* texture) override {
UNREACHABLE();
}
};
@@ -127,7 +127,8 @@ namespace dawn_native {
}
ASSERT(!IsError());
OnBeforePresent(texture);
if (GetDevice()->ConsumedError(OnBeforePresent(texture)))
return;
mImplementation.Present(mImplementation.userData);
}