Skip to content

Commit

Permalink
Merge pull request #11665 from hrydgard/remove-disable-stencil
Browse files Browse the repository at this point in the history
Remove the "Disable stencil test" hack setting
  • Loading branch information
unknownbrackets authored Dec 14, 2018
2 parents 60a81a6 + 3f8aec5 commit 6343e00
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 12 deletions.
1 change: 0 additions & 1 deletion Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ static ConfigSetting graphicsSettings[] = {
ReportedConfigSetting("TexScalingType", &g_Config.iTexScalingType, 0, true, true),
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("BloomHack", &g_Config.iBloomHack, 0, true, true),

// Not really a graphics setting...
Expand Down
1 change: 0 additions & 1 deletion Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ struct Config {
bool bEnableCheats;
bool bReloadCheats;
int iCwCheatRefreshRate;
bool bDisableStencilTest;
int iBloomHack; //0 = off, 1 = safe, 2 = balanced, 3 = aggressive
bool bTimerHack;
bool bBlockTransferGPU;
Expand Down
2 changes: 1 addition & 1 deletion Core/HLE/ReplaceTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ static int Hook_hexyzforce_monoclome_thread() {

static int Hook_starocean_write_stencil() {
const u32 fb_address = currentMIPS->r[MIPS_REG_T7];
if (Memory::IsVRAMAddress(fb_address) && !g_Config.bDisableStencilTest) {
if (Memory::IsVRAMAddress(fb_address)) {
gpu->PerformStencilUpload(fb_address, 0x00088000);
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion GPU/Common/GPUStateUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ static void ConvertStencilFunc5551(GenericStencilFuncState &state) {
}

void ConvertStencilFuncState(GenericStencilFuncState &state) {
state.enabled = gstate.isStencilTestEnabled() && !g_Config.bDisableStencilTest;
state.enabled = gstate.isStencilTestEnabled();
if (!state.enabled)
return;

Expand Down
4 changes: 1 addition & 3 deletions GPU/Directx9/StateMappingDX9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ void DrawEngineDX9::ApplyDrawState(int prim) {
}
}

bool enableStencilTest = !g_Config.bDisableStencilTest;

if (gstate_c.IsDirty(DIRTY_RASTER_STATE)) {
gstate_c.Clean(DIRTY_RASTER_STATE);
// Set Dither
Expand Down Expand Up @@ -231,7 +229,7 @@ void DrawEngineDX9::ApplyDrawState(int prim) {

// Stencil Test
bool alphaMask = gstate.isClearModeAlphaMask();
if (alphaMask && enableStencilTest) {
if (alphaMask) {
dxstate.stencilTest.enable();
dxstate.stencilOp.set(D3DSTENCILOP_REPLACE, D3DSTENCILOP_REPLACE, D3DSTENCILOP_REPLACE);
dxstate.stencilFunc.set(D3DCMP_ALWAYS, 255, 0xFF);
Expand Down
3 changes: 1 addition & 2 deletions GPU/GLES/StateMappingGLES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,12 @@ void DrawEngineGLES::ApplyDrawState(int prim) {

if (gstate_c.IsDirty(DIRTY_DEPTHSTENCIL_STATE)) {
gstate_c.Clean(DIRTY_DEPTHSTENCIL_STATE);
bool enableStencilTest = !g_Config.bDisableStencilTest;
if (gstate.isModeClear()) {
// Depth Test
if (gstate.isClearModeDepthMask()) {
framebufferManager_->SetDepthUpdated();
}
renderManager->SetStencilFunc(gstate.isClearModeAlphaMask() && enableStencilTest, GL_ALWAYS, 0xFF, 0xFF);
renderManager->SetStencilFunc(gstate.isClearModeAlphaMask(), GL_ALWAYS, 0xFF, 0xFF);
renderManager->SetStencilOp(0xFF, GL_REPLACE, GL_REPLACE, GL_REPLACE);
renderManager->SetDepth(true, gstate.isClearModeDepthMask() ? true : false, GL_ALWAYS);
} else {
Expand Down
3 changes: 0 additions & 3 deletions UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,6 @@ void GameSettingsScreen::CreateViews() {
return UI::EVENT_CONTINUE;
});

CheckBox *stencilTest = graphicsSettings->Add(new CheckBox(&g_Config.bDisableStencilTest, gr->T("Disable Stencil Test")));
stencilTest->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 6343e00

Please sign in to comment.