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

@@ -132,8 +132,9 @@ namespace dawn_native { namespace opengl {
return mLastSubmittedSerial + 1;
}
void Device::TickImpl() {
MaybeError Device::TickImpl() {
CheckPassedFences();
return {};
}
void Device::CheckPassedFences() {

View File

@@ -53,7 +53,7 @@ namespace dawn_native { namespace opengl {
Serial GetCompletedCommandSerial() const final override;
Serial GetLastSubmittedCommandSerial() const final override;
Serial GetPendingCommandSerial() const override;
void TickImpl() override;
MaybeError TickImpl() override;
ResultOrError<std::unique_ptr<StagingBufferBase>> CreateStagingBuffer(size_t size) override;
MaybeError CopyFromStagingToBuffer(StagingBufferBase* source,

View File

@@ -44,7 +44,8 @@ namespace dawn_native { namespace opengl {
TextureBase::TextureState::OwnedExternal);
}
void SwapChain::OnBeforePresent(TextureBase*) {
MaybeError SwapChain::OnBeforePresent(TextureBase*) {
return {};
}
}} // namespace dawn_native::opengl

View File

@@ -30,7 +30,7 @@ namespace dawn_native { namespace opengl {
protected:
TextureBase* GetNextTextureImpl(const TextureDescriptor* descriptor) override;
void OnBeforePresent(TextureBase* texture) override;
MaybeError OnBeforePresent(TextureBase* texture) override;
};
}} // namespace dawn_native::opengl