From 04701f9f1e629c642de0754f69131ac33e28247d Mon Sep 17 00:00:00 2001 From: Natasha Lee Date: Tue, 26 May 2020 20:33:03 +0000 Subject: [PATCH] Fire map callback if map async operation fails Bug: dawn:400 Change-Id: If656239714f2c088e52aff30ef27a20f2fc42ba8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21940 Commit-Queue: Natasha Lee Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng --- src/dawn_native/Buffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dawn_native/Buffer.cpp b/src/dawn_native/Buffer.cpp index b293b9617b..6da550bf26 100644 --- a/src/dawn_native/Buffer.cpp +++ b/src/dawn_native/Buffer.cpp @@ -271,7 +271,7 @@ namespace dawn_native { mState = BufferState::Mapped; if (GetDevice()->ConsumedError(MapReadAsyncImpl(mMapSerial))) { - // TODO(natlee@microsoft.com): if map op fails fire callback with DEVICE_LOST status + CallMapReadCallback(mMapSerial, WGPUBufferMapAsyncStatus_DeviceLost, nullptr, 0); return; } @@ -312,7 +312,7 @@ namespace dawn_native { mState = BufferState::Mapped; if (GetDevice()->ConsumedError(MapWriteAsyncImpl(mMapSerial))) { - // TODO(natlee@microsoft.com): if map op fails fire callback with DEVICE_LOST status + CallMapWriteCallback(mMapSerial, WGPUBufferMapAsyncStatus_DeviceLost, nullptr, 0); return; }