gsdx-d3d11: Remove Alpha Stencil hack.

Hack is obsolete/replaced with accurate date/date_one option/code.

There's pretty much no usecase for it remaining other than using it as
an alternative to skipdraw which removes/breaks transparency effects.
This commit is contained in:
lightningterror 2020-06-05 19:37:16 +02:00
parent 297f91ae7d
commit 19e872453d
7 changed files with 30 additions and 72 deletions

View File

@ -412,10 +412,6 @@ void GSdxApp::Init()
m_default_configuration["upscale_multiplier"] = "1";
m_default_configuration["UserHacks"] = "0";
m_default_configuration["UserHacks_align_sprite_X"] = "0";
#ifdef _WIN32
// Direct3D only hacks.
m_default_configuration["UserHacks_AlphaStencil"] = "0";
#endif
m_default_configuration["UserHacks_AutoFlush"] = "0";
m_default_configuration["UserHacks_DisableDepthSupport"] = "0";
m_default_configuration["UserHacks_Disable_Safe_Features"] = "0";

View File

@ -119,10 +119,9 @@ BEGIN
// Rendering Hacks:
GROUPBOX "Rendering Hacks",IDC_STATIC,7,7,196,114,0,WS_EX_TRANSPARENT
// Column one - HW Hacks
CONTROL "Alpha Stencil",IDC_ALPHASTENCIL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,19,57,8
CONTROL "Auto Flush",IDC_AUTO_FLUSH_HW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,32,55,8
CONTROL "Disable Depth Emulation",IDC_TC_DEPTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,45,92,8
CONTROL "Disable Safe Features",IDC_SAFE_FEATURES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,58,85,8
CONTROL "Auto Flush",IDC_AUTO_FLUSH_HW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,19,55,8
CONTROL "Disable Depth Emulation",IDC_TC_DEPTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,32,92,8
CONTROL "Disable Safe Features",IDC_SAFE_FEATURES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,45,85,8
// Column two - HW hacks
CONTROL "Fast Texture Invalidation",IDC_FAST_TC_INV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,106,19,93,8
CONTROL "Frame Buffer Conversion",IDC_CPU_FB_CONVERSION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,106,32,93,8

View File

@ -26,10 +26,6 @@ GSRendererDX11::GSRendererDX11()
: GSRendererHW(new GSTextureCache11(this))
{
m_sw_blending = theApp.GetConfigI("accurate_blending_unit_d3d11");
if (theApp.GetConfigB("UserHacks"))
UserHacks_AlphaStencil = theApp.GetConfigB("UserHacks_AlphaStencil");
else
UserHacks_AlphaStencil = false;
ResetStates();
}
@ -1036,28 +1032,6 @@ void GSRendererDX11::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sou
EmulateAtst(1, tex);
}
// FIXME: Purge it when remaining DATE cases in DATE selection are supported properly.
// Destination alpha pseudo stencil hack: use a stencil operation combined with an alpha test
// to only draw pixels which would cause the destination alpha test to fail in the future once.
// Unfortunately this also means only drawing those pixels at all, which is why this is a hack.
// It helps render transparency in Amagami, breaks a lot of other games.
if (UserHacks_AlphaStencil && DATE && !DATE_one && !m_texture_shuffle && m_om_bsel.wa && !m_context->TEST.ATE)
{
// fprintf(stderr, "%d: Alpha Stencil detected\n", s_n);
if (!m_context->FBA.FBA)
{
if (m_context->TEST.DATM == 0)
m_ps_sel.atst = 2; // >=
else
m_ps_sel.atst = 1; // <
ps_cb.FogColor_AREF.a = (float)0x80;
}
if (!(m_context->FBA.FBA && m_context->TEST.DATM == 1))
m_om_dssel.date_one = 1;
}
// END OF FIXME
if (tex)
{
EmulateTextureSampler(tex);

View File

@ -35,7 +35,6 @@ class GSRendererDX11 final : public GSRendererHW
};
private:
bool UserHacks_AlphaStencil;
bool m_bind_rtsample;
private:

View File

@ -202,9 +202,6 @@ const char* dialog_message(int ID, bool* updateText) {
"It will amplify RAM/VRAM spikes. Other games might be affected as well.";
// Windows only options.
#ifdef _WIN32
case IDC_ALPHASTENCIL:
return "Improves shadows/transparency rendering in games such as Amagami.\n\n"
"Note: It will break transparency rendering in many games, avoid using it.";
case IDC_ACCURATE_BLEND_UNIT_D3D11:
return "Control the accuracy level of the GS blending unit emulation.\n\n"
"None:\nFast but introduces various rendering issues.\n"

View File

@ -616,7 +616,6 @@ void GSHacksDlg::OnInit()
bool native = upscaling_multiplier == 1;
CheckDlgButton(m_hWnd, IDC_WILDHACK, theApp.GetConfigB("UserHacks_WildHack"));
CheckDlgButton(m_hWnd, IDC_ALPHASTENCIL, theApp.GetConfigB("UserHacks_AlphaStencil"));
CheckDlgButton(m_hWnd, IDC_PRELOAD_GS, theApp.GetConfigB("preload_frame_with_gs_data"));
CheckDlgButton(m_hWnd, IDC_ALIGN_SPRITE, theApp.GetConfigB("UserHacks_align_sprite_X"));
CheckDlgButton(m_hWnd, IDC_TC_DEPTH, theApp.GetConfigB("UserHacks_DisableDepthSupport"));
@ -674,9 +673,6 @@ void GSHacksDlg::OnInit()
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETY), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_TCOFFSETY2), hwhacks);
// Direct3D-only hacks:
EnableWindow(GetDlgItem(m_hWnd, IDC_ALPHASTENCIL), !ogl);
// OpenGL-only hacks:
EnableWindow(GetDlgItem(m_hWnd, IDC_TRI_FILTER), hwhacks && ogl);
EnableWindow(GetDlgItem(m_hWnd, IDC_TRI_FILTER_TEXT), hwhacks && ogl);
@ -704,7 +700,6 @@ void GSHacksDlg::OnInit()
AddTooltip(IDC_SKIPDRAWOFFSET);
AddTooltip(IDC_OFFSETHACK);
AddTooltip(IDC_WILDHACK);
AddTooltip(IDC_ALPHASTENCIL);
AddTooltip(IDC_ALIGN_SPRITE);
AddTooltip(IDC_ROUND_SPRITE);
AddTooltip(IDC_TCOFFSETX);
@ -813,7 +808,6 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
theApp.SetConfig("UserHacks_SkipDraw", skipdraw);
theApp.SetConfig("UserHacks_WildHack", (int)IsDlgButtonChecked(m_hWnd, IDC_WILDHACK));
theApp.SetConfig("UserHacks_AlphaStencil", (int)IsDlgButtonChecked(m_hWnd, IDC_ALPHASTENCIL));
theApp.SetConfig("preload_frame_with_gs_data", (int)IsDlgButtonChecked(m_hWnd, IDC_PRELOAD_GS));
theApp.SetConfig("UserHacks_align_sprite_X", (int)IsDlgButtonChecked(m_hWnd, IDC_ALIGN_SPRITE));
theApp.SetConfig("UserHacks_DisableDepthSupport", (int)IsDlgButtonChecked(m_hWnd, IDC_TC_DEPTH));

View File

@ -59,34 +59,33 @@
#define IDC_WILDHACK 2100
#define IDC_OFFSETHACK 2101
#define IDC_OFFSETHACK_TEXT 2102
#define IDC_ALPHASTENCIL 2103
#define IDC_TCOFFSETX 2104
#define IDC_TCOFFSETX2 2105
#define IDC_TCOFFSETX_TEXT 2106
#define IDC_TCOFFSETY 2107
#define IDC_TCOFFSETY2 2108
#define IDC_TCOFFSETY_TEXT 2109
#define IDC_TCOFFSET_TEXT 2110
#define IDC_ROUND_SPRITE 2111
#define IDC_ROUND_SPRITE_TEXT 2112
#define IDC_ALIGN_SPRITE 2113
#define IDC_TC_DEPTH 2114
#define IDC_PRELOAD_GS 2115
#define IDC_FAST_TC_INV 2116
#define IDC_AUTO_FLUSH_HW 2117
#define IDC_MEMORY_WRAPPING 2118
#define IDC_TRI_FILTER 2119
#define IDC_TRI_FILTER_TEXT 2120
#define IDC_SAFE_FEATURES 2121
#define IDC_MERGE_PP_SPRITE 2122
#define IDC_CPU_FB_CONVERSION 2123
#define IDC_SKIPDRAWHACK 2124
#define IDC_SKIPDRAWHACK_TEXT 2125
#define IDC_SKIPDRAWHACKEDIT 2126
#define IDC_SKIPDRAWOFFSET 2127
#define IDC_SKIPDRAWOFFSETEDIT 2128
#define IDC_HALF_SCREEN_TS 2129
#define IDC_HALF_SCREEN_TS_TEXT 2130
#define IDC_TCOFFSETX 2103
#define IDC_TCOFFSETX2 2104
#define IDC_TCOFFSETX_TEXT 2105
#define IDC_TCOFFSETY 2106
#define IDC_TCOFFSETY2 2107
#define IDC_TCOFFSETY_TEXT 2108
#define IDC_TCOFFSET_TEXT 2109
#define IDC_ROUND_SPRITE 2110
#define IDC_ROUND_SPRITE_TEXT 2111
#define IDC_ALIGN_SPRITE 2112
#define IDC_TC_DEPTH 2113
#define IDC_PRELOAD_GS 2114
#define IDC_FAST_TC_INV 2115
#define IDC_AUTO_FLUSH_HW 2116
#define IDC_MEMORY_WRAPPING 2117
#define IDC_TRI_FILTER 2118
#define IDC_TRI_FILTER_TEXT 2119
#define IDC_SAFE_FEATURES 2120
#define IDC_MERGE_PP_SPRITE 2121
#define IDC_CPU_FB_CONVERSION 2122
#define IDC_SKIPDRAWHACK 2123
#define IDC_SKIPDRAWHACK_TEXT 2124
#define IDC_SKIPDRAWHACKEDIT 2125
#define IDC_SKIPDRAWOFFSET 2126
#define IDC_SKIPDRAWOFFSETEDIT 2127
#define IDC_HALF_SCREEN_TS 2128
#define IDC_HALF_SCREEN_TS_TEXT 2129
// Shader:
#define IDC_SHADEBOOST 2140
#define IDC_FXAA 2141