Fixes crash for Metal Gear Solid V: Ground Zeroes.
Signed-off-by: Andrey Gusev andrey.goosev@gmail.com --- dlls/dxgi/swapchain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index 5b3ca5b5762..20e6fe3384a 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -601,7 +601,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetLastPresentCount(IDXGISwapCh { FIXME("iface %p, last_present_count %p stub!\n", iface, last_present_count);
- return E_NOTIMPL; + if (last_present_count) + *last_present_count = 0; + + return S_OK; }
/* IDXGISwapChain1 methods */
On Fri, 28 May 2021 at 16:03, Andrey Gusev andrey.goosev@gmail.com wrote:
@@ -601,7 +601,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetLastPresentCount(IDXGISwapCh { FIXME("iface %p, last_present_count %p stub!\n", iface, last_present_count);
- return E_NOTIMPL;
- if (last_present_count)
*last_present_count = 0;
- return S_OK;
}
Looking at the description for this function, it shouldn't be too hard to write a proper implementation and a small test. (In particular, the documentation claims this simply counts the number of Present() calls, not necessarily the number of finished presents.) Note that d3d12_swapchain_GetLastPresentCount() exists as well.