From 5959481a3e53bb04c8d7c034a04fd7dcdd2e893b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 15 Aug 2023 00:30:36 +0200 Subject: [PATCH] libretro D3D11: Attempt at fixing a build error --- Common/GPU/D3D11/thin3d_d3d11.cpp | 5 ++++- libretro/LibretroD3D11Context.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index 7c9f8308a1..1d42c8d1b4 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -438,7 +438,10 @@ void D3D11DrawContext::Present(PresentMode presentMode, int vblanks) { if (presentMode != PresentMode::FIFO) { interval = 0; } - swapChain_->Present(interval, 0); + // Safety for libretro + if (swapChain_) { + swapChain_->Present(interval, 0); + } curRenderTargetView_ = nullptr; curDepthStencilView_ = nullptr; frameCount_++; diff --git a/libretro/LibretroD3D11Context.cpp b/libretro/LibretroD3D11Context.cpp index 1ef528fc51..2a9da24dc4 100644 --- a/libretro/LibretroD3D11Context.cpp +++ b/libretro/LibretroD3D11Context.cpp @@ -46,7 +46,7 @@ void LibretroD3D11Context::CreateDrawContext() { ID3D11DeviceContext1 *context1 = nullptr; d3d11_->context->QueryInterface(__uuidof(ID3D11DeviceContext1), (void **)&context1); - draw_ = Draw::T3DCreateD3D11Context(d3d11_->device, d3d11_->context, device1, context1, d3d11_->featureLevel, NULL, adapterNames, 3); + draw_ = Draw::T3DCreateD3D11Context(d3d11_->device, d3d11_->context, device1, context1, nullptr, d3d11_->featureLevel, NULL, adapterNames, 3); } void LibretroD3D11Context::DestroyDrawContext() {