diff options
Diffstat (limited to 'src/gui/rhi')
-rw-r--r-- | src/gui/rhi/qrhid3d11.cpp | 7 | ||||
-rw-r--r-- | src/gui/rhi/qrhid3d12.cpp | 12 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index 58a8221a11..9f13784426 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -5200,8 +5200,11 @@ bool QD3D11SwapChain::createOrResize() } } if (FAILED(hr)) { - qWarning("Failed to create D3D11 swapchain: %s", - qPrintable(QSystemError::windowsComString(hr))); + qWarning("Failed to create D3D11 swapchain: %s" + " (Width=%u Height=%u Format=%u SampleCount=%u BufferCount=%u Scaling=%u SwapEffect=%u Stereo=%u)", + qPrintable(QSystemError::windowsComString(hr)), + desc.Width, desc.Height, UINT(desc.Format), desc.SampleDesc.Count, + desc.BufferCount, UINT(desc.Scaling), UINT(desc.SwapEffect), UINT(desc.Stereo)); return false; } } else { diff --git a/src/gui/rhi/qrhid3d12.cpp b/src/gui/rhi/qrhid3d12.cpp index 881f769710..9b139d5e56 100644 --- a/src/gui/rhi/qrhid3d12.cpp +++ b/src/gui/rhi/qrhid3d12.cpp @@ -1607,6 +1607,10 @@ QRhi::FrameOpResult QRhiD3D12::endFrame(QRhiSwapChain *swapChain, QRhi::EndFrame { presentFlags |= DXGI_PRESENT_ALLOW_TEARING; } + if (!swapChainD->swapChain) { + qWarning("Failed to present, no swapchain"); + return QRhi::FrameOpError; + } HRESULT hr = swapChainD->swapChain->Present(swapChainD->swapInterval, presentFlags); if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET) { qWarning("Device loss detected in Present()"); @@ -6239,7 +6243,7 @@ bool QD3D12SwapChain::createOrResize() if (!dcompTarget) { hr = rhiD->dcompDevice->CreateTargetForHwnd(hwnd, false, &dcompTarget); if (FAILED(hr)) { - qWarning("Failed to create Direct Compsition target for the window: %s", + qWarning("Failed to create Direct Composition target for the window: %s", qPrintable(QSystemError::windowsComString(hr))); } } @@ -6336,7 +6340,11 @@ bool QD3D12SwapChain::createOrResize() } } if (FAILED(hr)) { - qWarning("Failed to create D3D12 swapchain: %s", qPrintable(QSystemError::windowsComString(hr))); + qWarning("Failed to create D3D12 swapchain: %s" + " (Width=%u Height=%u Format=%u SampleCount=%u BufferCount=%u Scaling=%u SwapEffect=%u Stereo=%u)", + qPrintable(QSystemError::windowsComString(hr)), + desc.Width, desc.Height, UINT(desc.Format), desc.SampleDesc.Count, + desc.BufferCount, UINT(desc.Scaling), UINT(desc.SwapEffect), UINT(desc.Stereo)); return false; } |