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)