[dxgi] Handle invalid arguments passed to Present1

fixes a wine test failure.
This commit is contained in:
Philip Rebohle 2019-10-02 00:18:55 +02:00
parent f58c1c2d1d
commit d90d450618
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 3 additions and 6 deletions

View File

@ -255,18 +255,15 @@ namespace dxvk {
if (!IsWindow(m_window))
return DXGI_ERROR_INVALID_CALL;
if (SyncInterval > 4)
return DXGI_ERROR_INVALID_CALL;
if (PresentFlags & DXGI_PRESENT_TEST)
return S_OK;
std::lock_guard<std::recursive_mutex> lockWin(m_lockWindow);
std::lock_guard<std::mutex> lockBuf(m_lockBuffer);
// Higher values are not allowed according to the Microsoft documentation:
//
// "1 through 4 - Synchronize presentation after the nth vertical blank."
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb174576(v=vs.85).aspx
SyncInterval = std::min<UINT>(SyncInterval, 4);
try {
return m_presenter->Present(SyncInterval, PresentFlags, nullptr);
} catch (const DxvkError& err) {