From fc91fe1d3417656721132b0dc4c2558407b95ba0 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 9 Dec 2019 23:27:56 +0100 Subject: [PATCH] [dxgi] Add fake implementation of DxgiFactory::EnumWarpAdapter Apparently FIFA 19 needs this. --- src/dxgi/dxgi_factory.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/dxgi/dxgi_factory.cpp b/src/dxgi/dxgi_factory.cpp index 061fbd754..7d61f34ff 100644 --- a/src/dxgi/dxgi_factory.cpp +++ b/src/dxgi/dxgi_factory.cpp @@ -228,8 +228,18 @@ namespace dxvk { void** ppvAdapter) { InitReturnPtr(ppvAdapter); - Logger::err("DxgiFactory::EnumWarpAdapter: Not implemented"); - return E_NOTIMPL; + static bool s_errorShown = false; + + if (!std::exchange(s_errorShown, true)) + Logger::warn("DxgiFactory::EnumWarpAdapter: WARP not supported, returning first hardware adapter"); + + Com adapter; + HRESULT hr = EnumAdapters1(0, &adapter); + + if (FAILED(hr)) + return hr; + + return adapter->QueryInterface(riid, ppvAdapter); }