From 1d96ead852717f5d92f6661989412612c03320d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 26 May 2017 10:23:45 +0200 Subject: [PATCH 1/2] Remove "Always Depth Write" setting. One step forward for #8171 --- Core/Config.cpp | 1 - Core/Config.h | 1 - GPU/Directx9/StateMappingDX9.cpp | 3 +-- GPU/GLES/StateMappingGLES.cpp | 7 +++---- UI/GameSettingsScreen.cpp | 3 --- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index f06b99c9d81a..011113e18ce1 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -532,7 +532,6 @@ static ConfigSetting graphicsSettings[] = { ReportedConfigSetting("TexDeposterize", &g_Config.bTexDeposterize, false, true, true), ConfigSetting("VSyncInterval", &g_Config.bVSync, false, true, true), ReportedConfigSetting("DisableStencilTest", &g_Config.bDisableStencilTest, false, true, true), - ReportedConfigSetting("AlwaysDepthWrite", &g_Config.bAlwaysDepthWrite, false, true, true), ReportedConfigSetting("BloomHack", &g_Config.iBloomHack, 0, true, true), // Not really a graphics setting... diff --git a/Core/Config.h b/Core/Config.h index d598989cfed6..50c713f6fcad 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -209,7 +209,6 @@ struct Config { bool bReloadCheats; int iCwCheatRefreshRate; bool bDisableStencilTest; - bool bAlwaysDepthWrite; int iBloomHack; //0 = off, 1 = safe, 2 = balanced, 3 = aggressive bool bTimerHack; bool bBlockTransferGPU; diff --git a/GPU/Directx9/StateMappingDX9.cpp b/GPU/Directx9/StateMappingDX9.cpp index 8fbe20cc10d6..9e3abf2a7c3f 100644 --- a/GPU/Directx9/StateMappingDX9.cpp +++ b/GPU/Directx9/StateMappingDX9.cpp @@ -195,7 +195,6 @@ void DrawEngineDX9::ApplyDrawState(int prim) { } } - bool alwaysDepthWrite = g_Config.bAlwaysDepthWrite; bool enableStencilTest = !g_Config.bDisableStencilTest; { @@ -222,7 +221,7 @@ void DrawEngineDX9::ApplyDrawState(int prim) { dxstate.depthTest.enable(); dxstate.depthFunc.set(D3DCMP_ALWAYS); dxstate.depthWrite.set(gstate.isClearModeDepthMask()); - if (gstate.isClearModeDepthMask() || alwaysDepthWrite) { + if (gstate.isClearModeDepthMask()) { framebufferManager_->SetDepthUpdated(); } diff --git a/GPU/GLES/StateMappingGLES.cpp b/GPU/GLES/StateMappingGLES.cpp index 36657bc6a9f4..8a1a2a3845b5 100644 --- a/GPU/GLES/StateMappingGLES.cpp +++ b/GPU/GLES/StateMappingGLES.cpp @@ -277,13 +277,12 @@ void DrawEngineGLES::ApplyDrawState(int prim) { } { - bool alwaysDepthWrite = g_Config.bAlwaysDepthWrite; bool enableStencilTest = !g_Config.bDisableStencilTest; if (gstate.isModeClear()) { // Depth Test glstate.depthTest.enable(); glstate.depthFunc.set(GL_ALWAYS); - glstate.depthWrite.set(gstate.isClearModeDepthMask() || alwaysDepthWrite ? GL_TRUE : GL_FALSE); + glstate.depthWrite.set(gstate.isClearModeDepthMask() ? GL_TRUE : GL_FALSE); if (gstate.isClearModeDepthMask() || alwaysDepthWrite) { framebufferManager_->SetDepthUpdated(); } @@ -306,8 +305,8 @@ void DrawEngineGLES::ApplyDrawState(int prim) { if (gstate.isDepthTestEnabled()) { glstate.depthTest.enable(); glstate.depthFunc.set(compareOps[gstate.getDepthTestFunction()]); - glstate.depthWrite.set(gstate.isDepthWriteEnabled() || alwaysDepthWrite ? GL_TRUE : GL_FALSE); - if (gstate.isDepthWriteEnabled() || alwaysDepthWrite) { + glstate.depthWrite.set(gstate.isDepthWriteEnabled() ? GL_TRUE : GL_FALSE); + if (gstate.isDepthWriteEnabled()) { framebufferManager_->SetDepthUpdated(); } } else { diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 8ecca8339a35..4ca27416c3e9 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -425,9 +425,6 @@ void GameSettingsScreen::CreateViews() { CheckBox *stencilTest = graphicsSettings->Add(new CheckBox(&g_Config.bDisableStencilTest, gr->T("Disable Stencil Test"))); stencilTest->SetDisabledPtr(&g_Config.bSoftwareRendering); - CheckBox *depthWrite = graphicsSettings->Add(new CheckBox(&g_Config.bAlwaysDepthWrite, gr->T("Always Depth Write"))); - depthWrite->SetDisabledPtr(&g_Config.bSoftwareRendering); - static const char *bloomHackOptions[] = { "Off", "Safe", "Balanced", "Aggressive" }; PopupMultiChoice *bloomHack = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iBloomHack, gr->T("Lower resolution for effects (reduces artifacts)"), bloomHackOptions, 0, ARRAY_SIZE(bloomHackOptions), gr->GetName(), screenManager())); bloomHackEnable_ = !g_Config.bSoftwareRendering && (g_Config.iInternalResolution != 1); From 6669fd0879038649862d94bd87d4bfb44bed07a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 26 May 2017 16:42:38 +0200 Subject: [PATCH 2/2] Buildfix --- GPU/GLES/StateMappingGLES.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GLES/StateMappingGLES.cpp b/GPU/GLES/StateMappingGLES.cpp index 8a1a2a3845b5..1437eea535c4 100644 --- a/GPU/GLES/StateMappingGLES.cpp +++ b/GPU/GLES/StateMappingGLES.cpp @@ -283,7 +283,7 @@ void DrawEngineGLES::ApplyDrawState(int prim) { glstate.depthTest.enable(); glstate.depthFunc.set(GL_ALWAYS); glstate.depthWrite.set(gstate.isClearModeDepthMask() ? GL_TRUE : GL_FALSE); - if (gstate.isClearModeDepthMask() || alwaysDepthWrite) { + if (gstate.isClearModeDepthMask()) { framebufferManager_->SetDepthUpdated(); }