Skip to content

Commit af6a8fd

Browse files
Synchronize changes from 1.6 branch [ci skip]
9a6bac7 Fix recently introduced log spam 3390d22 Addendum to e556d42
2 parents 2ed6ad2 + 9a6bac7 commit af6a8fd

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Client/core/DXHook/CDirect3DEvents9.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void CDirect3DEvents9::OnBeginScene(IDirect3DDevice9* pDevice)
7373

7474
bool CDirect3DEvents9::OnEndScene(IDirect3DDevice9* pDevice)
7575
{
76+
CloseActiveShader();
7677
return true;
7778
}
7879

@@ -94,22 +95,22 @@ void CDirect3DEvents9::OnInvalidate(IDirect3DDevice9* pDevice)
9495
g_pCore->GetGraphics()->GetRenderItemManager()->SaveReadableDepthBuffer();
9596
g_pCore->GetGraphics()->GetRenderItemManager()->FlushNonAARenderTarget();
9697

98+
// Ensure any in-progress effect passes are wrapped up before ending the scene
99+
CloseActiveShader();
100+
97101
if (g_bInMTAScene || g_bInGTAScene)
98102
{
99103
const HRESULT hrEndScene = pDevice->EndScene();
100104
if (FAILED(hrEndScene))
101105
WriteDebugEvent(SString("OnInvalidate: EndScene failed: %08x", hrEndScene));
102106
}
103-
104-
CloseActiveShader();
105107
}
106108
else
107109
{
110+
CloseActiveShader(false);
111+
108112
if (g_bInMTAScene || g_bInGTAScene)
109113
WriteDebugEvent("OnInvalidate: device lost, skipping EndScene and pending GPU work");
110-
111-
// Prevent reuse of partially configured shader state across device resets without touching the lost device
112-
CloseActiveShader(false);
113114
}
114115

115116
g_bInMTAScene = false;
@@ -219,6 +220,9 @@ void CDirect3DEvents9::OnPresent(IDirect3DDevice9* pDevice)
219220

220221
CGraphics::GetSingleton().LeavingMTARenderZone();
221222

223+
// Finalize any lingering shader passes before wrapping the scene
224+
CloseActiveShader();
225+
222226
// End the scene that we started.
223227
if (g_bInMTAScene)
224228
{

Client/core/DXHook/CProxyDirect3DDevice9.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,6 @@ VOID CProxyDirect3DDevice9::SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3D
584584

585585
// Set the adjusted gamma ramp
586586
m_pDevice->SetGammaRamp(iSwapChain, Flags, &adjustedRamp);
587-
588-
WriteDebugEvent("Applied gamma adjustment for borderless windowed mode");
589587
}
590588
else
591589
{

Client/core/Graphics/CGraphics.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,6 @@ void CGraphics::SaveGTARenderStates()
20052005
// Prevent GPU driver hang by checking device state before creating state blocks
20062006
if (m_pDevice->TestCooperativeLevel() != D3D_OK)
20072007
{
2008-
WriteDebugEvent("CGraphics::SaveGTARenderStates - Device not cooperative, skipping state block creation");
20092008
return;
20102009
}
20112010

@@ -2041,7 +2040,6 @@ void CGraphics::RestoreGTARenderStates()
20412040
// Check device state before attempting to restore
20422041
if (m_pDevice->TestCooperativeLevel() != D3D_OK)
20432042
{
2044-
WriteDebugEvent("CGraphics::RestoreGTARenderStates - Device not cooperative, skipping state restoration");
20452043
SAFE_RELEASE(m_pSavedStateBlock);
20462044
return;
20472045
}

0 commit comments

Comments
 (0)