mirror of https://github.com/PCSX2/pcsx2.git
GSdx-D3D11: Avoid undefined behavior in swapchain
PCSX2 sends a negative value (-1) to GSdx when adaptive mode is specified for Vsync, this mode is exclusive to OpenGL at the moment and is unimplemented on the D3D11 renderer. Also the present function of swapchain only accepts values from 0 to 4 as parameter, hence passing negative values to the function is undefined behavior. So let's fallback to standard synchronization method on D3D11 when PCSX2 requests for adaptive mode.
This commit is contained in:
parent
420f111611
commit
8fe8cad8f9
|
@ -432,6 +432,11 @@ void GSDevice11::SetExclusive(bool isExcl)
|
|||
}
|
||||
}
|
||||
|
||||
void GSDevice11::SetVSync(int vsync)
|
||||
{
|
||||
m_vsync = vsync ? 1 : 0;
|
||||
}
|
||||
|
||||
void GSDevice11::Flip()
|
||||
{
|
||||
m_swapchain->Present(m_vsync, 0);
|
||||
|
|
|
@ -170,6 +170,7 @@ public:
|
|||
bool Create(const std::shared_ptr<GSWnd> &wnd);
|
||||
bool Reset(int w, int h);
|
||||
void Flip();
|
||||
void SetVSync(int vsync) final;
|
||||
|
||||
void SetExclusive(bool isExcl);
|
||||
|
||||
|
|
Loading…
Reference in New Issue