mirror of https://github.com/doitsujin/dxvk
[d3d9] Only use GDI GetFrontBufferData when Gamescope WSI isn't enabled
This commit is contained in:
parent
97347a5846
commit
e4e89db23c
|
@ -183,6 +183,8 @@ namespace dxvk {
|
|||
m_activeRTsWhichAreTextures = 0;
|
||||
m_alphaSwizzleRTs = 0;
|
||||
m_lastHazardsRT = 0;
|
||||
|
||||
m_gamescopeWSI = dxvk::env::getEnvVar("ENABLE_GAMESCOPE_WSI") == "1";
|
||||
}
|
||||
|
||||
|
||||
|
@ -1094,7 +1096,9 @@ namespace dxvk {
|
|||
return D3DERR_INVALIDCALL;
|
||||
|
||||
#ifdef _WIN32
|
||||
return D3D9SwapChainEx::GetFrontBufferDataGDI(pDestSurface);
|
||||
if (!IsGamescopeWSIEnabled()) {
|
||||
return D3D9SwapChainEx::GetFrontBufferDataGDI(pDestSurface);
|
||||
}
|
||||
#endif
|
||||
|
||||
D3D9DeviceLock lock = LockDevice();
|
||||
|
|
|
@ -1273,6 +1273,10 @@ namespace dxvk {
|
|||
m_mostRecentlyUsedSwapchain = m_implicitSwapchain.ptr();
|
||||
}
|
||||
|
||||
bool IsGamescopeWSIEnabled() const {
|
||||
return m_gamescopeWSI;
|
||||
}
|
||||
|
||||
Com<D3D9InterfaceEx> m_parent;
|
||||
D3DDEVTYPE m_deviceType;
|
||||
HWND m_window;
|
||||
|
@ -1439,6 +1443,8 @@ namespace dxvk {
|
|||
|
||||
D3D9SwapChainEx* m_mostRecentlyUsedSwapchain = nullptr;
|
||||
|
||||
bool m_gamescopeWSI;
|
||||
|
||||
#ifdef D3D9_ALLOW_UNMAPPING
|
||||
lru_list<D3D9CommonTexture*> m_mappedTextures;
|
||||
#endif
|
||||
|
|
|
@ -321,7 +321,7 @@ namespace dxvk {
|
|||
|
||||
HRESULT STDMETHODCALLTYPE D3D9SwapChainEx::GetFrontBufferData(IDirect3DSurface9* pDestSurface) {
|
||||
#ifdef _WIN32
|
||||
if (m_presentParams.Windowed || !HasFrontBuffer()) {
|
||||
if (!m_parent->IsGamescopeWSIEnabled() && (m_presentParams.Windowed || !HasFrontBuffer())) {
|
||||
return D3D9SwapChainEx::GetFrontBufferDataGDI(pDestSurface);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue