Skip to content

Commit

Permalink
Merge pull request #9726 from hrydgard/remove-always-depth-write
Browse files Browse the repository at this point in the history
Remove "Always Depth Write" setting. One step forward for #8171
  • Loading branch information
unknownbrackets committed May 26, 2017
2 parents ba48385 + 6669fd0 commit 708a54d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion Core/Config.cpp
Expand Up @@ -531,7 +531,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...
Expand Down
1 change: 0 additions & 1 deletion Core/Config.h
Expand Up @@ -208,7 +208,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;
Expand Down
3 changes: 1 addition & 2 deletions GPU/Directx9/StateMappingDX9.cpp
Expand Up @@ -195,7 +195,6 @@ void DrawEngineDX9::ApplyDrawState(int prim) {
}
}

bool alwaysDepthWrite = g_Config.bAlwaysDepthWrite;
bool enableStencilTest = !g_Config.bDisableStencilTest;

{
Expand All @@ -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();
}

Expand Down
9 changes: 4 additions & 5 deletions GPU/GLES/StateMappingGLES.cpp
Expand Up @@ -277,14 +277,13 @@ 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);
if (gstate.isClearModeDepthMask() || alwaysDepthWrite) {
glstate.depthWrite.set(gstate.isClearModeDepthMask() ? GL_TRUE : GL_FALSE);
if (gstate.isClearModeDepthMask()) {
framebufferManager_->SetDepthUpdated();
}

Expand All @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions UI/GameSettingsScreen.cpp
Expand Up @@ -424,9 +424,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);
Expand Down

0 comments on commit 708a54d

Please sign in to comment.