diff --git a/Core/Config.cpp b/Core/Config.cpp index e455cfa761..bef7c41f7c 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -571,6 +571,7 @@ static ConfigSetting debuggerSettings[] = { static ConfigSetting speedHackSettings[] = { ReportedConfigSetting("PrescaleUV", &g_Config.bPrescaleUV, false), + ReportedConfigSetting("DisableAlphaTest", &g_Config.bDisableAlphaTest, false), ConfigSetting(false), }; diff --git a/Core/Config.h b/Core/Config.h index 8df0ae0c64..276a77e53f 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -254,6 +254,7 @@ public: // * Still has major problems so off by default - need to store tex scale/offset per DeferredDrawCall, // which currently isn't done so if texscale/offset isn't static (like in Tekken 6) things go wrong. bool bPrescaleUV; + bool bDisableAlphaTest; // Helps PowerVR immensely, breaks some graphics // End GLES hacks. // Risky JIT optimizations diff --git a/GPU/GLES/FragmentShaderGenerator.cpp b/GPU/GLES/FragmentShaderGenerator.cpp index 8ebd5db081..d7e88f33e5 100644 --- a/GPU/GLES/FragmentShaderGenerator.cpp +++ b/GPU/GLES/FragmentShaderGenerator.cpp @@ -350,7 +350,7 @@ void ComputeFragmentShaderID(FragmentShaderID *id) { } else { bool lmode = gstate.isUsingSecondaryColor() && gstate.isLightingEnabled(); bool enableFog = gstate.isFogEnabled() && !gstate.isModeThrough(); - bool enableAlphaTest = gstate.isAlphaTestEnabled() && !IsAlphaTestTriviallyTrue(); + bool enableAlphaTest = gstate.isAlphaTestEnabled() && !IsAlphaTestTriviallyTrue() && !g_Config.bDisableAlphaTest; bool alphaTestAgainstZero = gstate.getAlphaTestRef() == 0; bool enableColorTest = gstate.isColorTestEnabled() && !IsColorTestTriviallyTrue(); bool alphaToColorDoubling = AlphaToColorDoubling(); @@ -497,7 +497,7 @@ void GenerateFragmentShader(char *buffer) { bool lmode = gstate.isUsingSecondaryColor() && gstate.isLightingEnabled(); bool doTexture = gstate.isTextureMapEnabled() && !gstate.isModeClear(); bool enableFog = gstate.isFogEnabled() && !gstate.isModeThrough() && !gstate.isModeClear(); - bool enableAlphaTest = gstate.isAlphaTestEnabled() && !IsAlphaTestTriviallyTrue() && !gstate.isModeClear(); + bool enableAlphaTest = gstate.isAlphaTestEnabled() && !IsAlphaTestTriviallyTrue() && !gstate.isModeClear() && !g_Config.bDisableAlphaTest; bool alphaTestAgainstZero = gstate.getAlphaTestRef() == 0; bool enableColorTest = gstate.isColorTestEnabled() && !IsColorTestTriviallyTrue() && !gstate.isModeClear(); bool alphaToColorDoubling = AlphaToColorDoubling(); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index b52957130b..3ca433b436 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -189,6 +189,8 @@ void GameSettingsScreen::CreateViews() { graphicsSettings->Add(new ItemHeader(gs->T("Hack Settings", "Hack Settings (these WILL cause glitches)"))); graphicsSettings->Add(new CheckBox(&g_Config.bTimerHack, gs->T("Timer Hack"))); + // Maybe hide this on non-PVR? + graphicsSettings->Add(new CheckBox(&g_Config.bDisableAlphaTest, gs->T("Disable Alpha Test (PowerVR speedup)")))->OnClick.Handle(this, &GameSettingsScreen::OnShaderChange); graphicsSettings->Add(new CheckBox(&g_Config.bDisableStencilTest, gs->T("Disable Stencil Test"))); graphicsSettings->Add(new CheckBox(&g_Config.bAlwaysDepthWrite, gs->T("Always Depth Write"))); CheckBox *prescale = graphicsSettings->Add(new CheckBox(&g_Config.bPrescaleUV, gs->T("Texture Coord Speedhack")));