Handle Device Lost for SwapChain

Bug: dawn:68
Change-Id: I16e00bb2e203e71fd0840b71bc027e6fbea4e52c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15723
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Natasha Lee <natlee@microsoft.com>
This commit is contained in:
Natasha Lee
2020-02-11 21:30:25 +00:00
committed by Commit Bot service account
parent 713d9cbf93
commit 2fd6181929
3 changed files with 36 additions and 1 deletions

View File

@@ -220,6 +220,7 @@ namespace dawn_native {
wgpu::TextureUsage allowedUsage,
uint32_t width,
uint32_t height) const {
DAWN_TRY(GetDevice()->ValidateIsAlive());
DAWN_TRY(GetDevice()->ValidateObject(this));
DAWN_TRY(ValidateTextureUsage(allowedUsage));
@@ -233,6 +234,7 @@ namespace dawn_native {
}
MaybeError OldSwapChainBase::ValidateGetCurrentTextureView() const {
DAWN_TRY(GetDevice()->ValidateIsAlive());
DAWN_TRY(GetDevice()->ValidateObject(this));
if (mWidth == 0) {
@@ -244,6 +246,7 @@ namespace dawn_native {
}
MaybeError OldSwapChainBase::ValidatePresent() const {
DAWN_TRY(GetDevice()->ValidateIsAlive());
DAWN_TRY(GetDevice()->ValidateObject(this));
if (mCurrentTextureView.Get() == nullptr) {