1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 23:52:20 +01:00

[d3d8] Validate D3D9 auto depth stencil query

This commit is contained in:
WinterSnowfall 2024-09-27 01:15:09 +03:00 committed by Philip Rebohle
parent 1675aea857
commit 4f90ad46b9

View File

@ -405,9 +405,11 @@ namespace dxvk {
m_backBuffers[i] = new D3D8Surface(this, std::move(pSurface9)); m_backBuffers[i] = new D3D8Surface(this, std::move(pSurface9));
} }
Com<d3d9::IDirect3DSurface9> pStencil9 = nullptr; Com<d3d9::IDirect3DSurface9> pStencil9;
GetD3D9()->GetDepthStencilSurface(&pStencil9); // This call will fail if the D3D9 device is created without
m_autoDepthStencil = new D3D8Surface(this, std::move(pStencil9)); // the EnableAutoDepthStencil presentation parameter set to TRUE.
HRESULT res = GetD3D9()->GetDepthStencilSurface(&pStencil9);
m_autoDepthStencil = FAILED(res) ? nullptr : new D3D8Surface(this, std::move(pStencil9));
m_renderTarget = m_backBuffers[0]; m_renderTarget = m_backBuffers[0];
m_depthStencil = m_autoDepthStencil; m_depthStencil = m_autoDepthStencil;