From ccbaeb528d123faae97404bdfa960e5755ad430f Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 3 Oct 2016 12:27:11 -0700 Subject: [PATCH] ScreenGrab12 missing some error handling --- ScreenGrab/ScreenGrab12.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ScreenGrab/ScreenGrab12.cpp b/ScreenGrab/ScreenGrab12.cpp index 1478a89..52266e2 100644 --- a/ScreenGrab/ScreenGrab12.cpp +++ b/ScreenGrab/ScreenGrab12.cpp @@ -764,13 +764,17 @@ namespace // Transition the resource to the next state TransitionResource(commandList.Get(), pSource, D3D12_RESOURCE_STATE_COPY_SOURCE, afterState); - commandList->Close(); + hr = commandList->Close(); + if (FAILED(hr)) + return hr; // Execute the command list pCommandQ->ExecuteCommandLists(1, (ID3D12CommandList**)commandList.GetAddressOf()); // Signal the fence - pCommandQ->Signal(fence.Get(), 1); + hr = pCommandQ->Signal(fence.Get(), 1); + if (FAILED(hr)) + return hr; // Block until the copy is complete while (fence->GetCompletedValue() < 1)