Skip to content
Permalink
Browse files

gsdx-sw: Add an option to toggle auto flush on sw renderer.

Windows + Linux.
  • Loading branch information...
lightningterror committed Apr 30, 2019
1 parent 87f3685 commit 5a69a2f68954974473aea8c28e8d900a33dbbae8
@@ -364,6 +364,7 @@ void GSdxApp::Init()
m_default_configuration["accurate_date"] = "1";
m_default_configuration["accurate_blending_unit"] = "1";
m_default_configuration["AspectRatio"] = "1";
m_default_configuration["autoflush_sw"] = "1";
m_default_configuration["capture_enabled"] = "0";
m_default_configuration["capture_out_dir"] = "/tmp/GSdx_Capture";
m_default_configuration["capture_threads"] = "4";
@@ -121,7 +121,7 @@ BEGIN
// Column one - HW Hacks
CONTROL "Align Sprite",IDC_ALIGN_SPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,19,58,8
CONTROL "Alpha Stencil",IDC_ALPHASTENCIL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,32,57,8
CONTROL "Auto Flush",IDC_AUTO_FLUSH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,45,55,8
CONTROL "Auto Flush",IDC_AUTO_FLUSH_HW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,45,55,8
CONTROL "Disable Depth Emulation",IDC_TC_DEPTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,58,92,8
CONTROL "Disable Safe Features",IDC_SAFE_FEATURES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,71,85,8
// Column two - HW hacks
@@ -327,10 +327,11 @@ BEGIN
COMBOBOX IDC_ACCURATE_BLEND_UNIT_D3D11,104,269,127,118,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
// Software Renderer Settings:
GROUPBOX "Software Renderer Settings",IDC_STATIC,6,295,230,40,BS_CENTER
CONTROL "Edge Anti-aliasing (Del)",IDC_AA1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,306,91,10
LTEXT "Rendering threads:",IDC_SWTHREADS_TEXT,123,307,65,8
EDITTEXT IDC_SWTHREADS_EDIT,197,305,34,13,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_SWTHREADS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,221,304,11,14
CONTROL "Auto Flush",IDC_AUTO_FLUSH_SW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,306,91,10
CONTROL "Edge Anti-aliasing (Del)",IDC_AA1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,124,306,91,10
LTEXT "Rendering threads:",IDC_SWTHREADS_TEXT,124,321,65,8
EDITTEXT IDC_SWTHREADS_EDIT,197,319,34,13,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_SWTHREADS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,0,0,11,14
CONTROL "Mipmapping",IDC_MIPMAP_SW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,322,90,10
END

@@ -77,9 +77,9 @@ GSRendererSW::GSRendererSW(int threads)

m_dump_root = root_sw;

// Reset handler with the auto flush hack enabled on the SW renderer
// Impact on perf is rather small, and it avoids an extra hack option.
if (!GLLoader::in_replayer) {
// Reset handler with the auto flush hack enabled on the SW renderer.
// Some games run better without the hack so rely on ini/gui option.
if (!GLLoader::in_replayer && theApp.GetConfigB("autoflush_sw")) {
m_userhacks_auto_flush = true;
ResetHandlers();
}
@@ -338,16 +338,19 @@ void populate_sw_table(GtkWidget* sw_table)
GtkWidget* threads_label = left_label("Extra rendering threads:");
GtkWidget* threads_spin = CreateSpinButton(0, 32, "extrathreads");

GtkWidget* aa_check = CreateCheckBox("Edge Anti-aliasing (Del)", "aa1");
GtkWidget* mipmap_check = CreateCheckBox("Mipmapping", "mipmap");
GtkWidget* aa_check = CreateCheckBox("Edge Anti-aliasing (Del)", "aa1");
GtkWidget* mipmap_check = CreateCheckBox("Mipmapping", "mipmap");
GtkWidget* autoflush_sw_check = CreateCheckBox("Auto Flush", "autoflush_sw");

AddTooltip(aa_check, IDC_AA1);
AddTooltip(mipmap_check, IDC_MIPMAP_SW);
AddTooltip(autoflush_sw_check, IDC_AUTO_FLUSH_SW);
AddTooltip(threads_label, threads_spin, IDC_SWTHREADS);

s_table_line = 0;
InsertWidgetInTable(sw_table , threads_label, threads_spin);
InsertWidgetInTable(sw_table , aa_check , mipmap_check);
InsertWidgetInTable(sw_table , threads_label , threads_spin);
InsertWidgetInTable(sw_table , autoflush_sw_check , aa_check);
InsertWidgetInTable(sw_table , mipmap_check);
}

void populate_shader_table(GtkWidget* shader_table)
@@ -479,7 +482,7 @@ void populate_hack_table(GtkWidget* hack_table)
AddTooltip(hack_fast_inv, IDC_FAST_TC_INV);
AddTooltip(hack_depth_check, IDC_TC_DEPTH);
AddTooltip(hack_cpu_fbcv, IDC_CPU_FB_CONVERSION);
AddTooltip(hack_auto_flush, IDC_AUTO_FLUSH);
AddTooltip(hack_auto_flush, IDC_AUTO_FLUSH_HW);
AddTooltip(hack_safe_features, IDC_SAFE_FEATURES);
AddTooltip(hack_merge_sprite, IDC_MERGE_PP_SPRITE);
AddTooltip(hack_wrap_mem, IDC_MEMORY_WRAPPING);
@@ -488,7 +491,7 @@ void populate_hack_table(GtkWidget* hack_table)


s_table_line = 0;
//Hacks
// Hacks
// Column one and two HW Hacks
InsertWidgetInTable(hack_table , align_sprite_check , hack_cpu_fbcv);
InsertWidgetInTable(hack_table , hack_auto_flush , hack_wrap_mem);
@@ -141,11 +141,15 @@ const char* dialog_message(int ID, bool* updateText) {
return "Enables external shader for additional post-processing effects.";
case IDC_FXAA:
return "Enables fast approximate anti-aliasing. Small performance impact.";
case IDC_AUTO_FLUSH:
case IDC_AUTO_FLUSH_HW:
return "Force a primitive flush when a framebuffer is also an input texture.\n"
"Fixes some processing effects such as the shadows in the Jak series and radiosity in GTA:SA.\n"
"Warning: it's very costly on the performance.\n\n"
"Warning: It's very costly on the performance.\n\n"
"Note: OpenGL HW renderer is able to handle Jak shadows at full speed without this option.";
case IDC_AUTO_FLUSH_SW:
return "Force a primitive flush when a framebuffer is also an input texture.\n"
"Fixes some processing effects such as the shadows in the Jak series and radiosity in GTA:SA.\n"
"Warning: It's very costly on the performance.";
case IDC_SAFE_FEATURES:
return "This option disables multiple safe features.\n\n"
"Disables accurate Unscale Point and Line rendering.\n"
@@ -76,7 +76,8 @@ enum {
IDC_FAST_TC_INV,
IDC_LARGE_FB,
IDC_LINEAR_PRESENT,
IDC_AUTO_FLUSH,
IDC_AUTO_FLUSH_HW,
IDC_AUTO_FLUSH_SW,
IDC_SAFE_FEATURES,
IDC_MEMORY_WRAPPING,
IDC_MERGE_PP_SPRITE,
@@ -132,6 +132,7 @@ void GSSettingsDlg::OnInit()
CheckDlgButton(m_hWnd, IDC_LARGE_FB, theApp.GetConfigB("large_framebuffer"));
CheckDlgButton(m_hWnd, IDC_MIPMAP_SW, theApp.GetConfigB("mipmap"));
CheckDlgButton(m_hWnd, IDC_AA1, theApp.GetConfigB("aa1"));
CheckDlgButton(m_hWnd, IDC_AUTO_FLUSH_SW, theApp.GetConfigB("autoflush_sw"));

// Hacks
CheckDlgButton(m_hWnd, IDC_HACKS_ENABLED, theApp.GetConfigB("UserHacks"));
@@ -157,6 +158,7 @@ void GSSettingsDlg::OnInit()
AddTooltip(IDC_MIPMAP_SW);
AddTooltip(IDC_SWTHREADS);
AddTooltip(IDC_SWTHREADS_EDIT);
AddTooltip(IDC_AUTO_FLUSH_SW);
AddTooltip(IDC_LARGE_FB);

UpdateControls();
@@ -283,6 +285,7 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code)
theApp.SetConfig("paltex", (int)IsDlgButtonChecked(m_hWnd, IDC_PALTEX));
theApp.SetConfig("large_framebuffer", (int)IsDlgButtonChecked(m_hWnd, IDC_LARGE_FB));
theApp.SetConfig("aa1", (int)IsDlgButtonChecked(m_hWnd, IDC_AA1));
theApp.SetConfig("autoflush_sw", (int)IsDlgButtonChecked(m_hWnd, IDC_AUTO_FLUSH_SW));
theApp.SetConfig("UserHacks", (int)IsDlgButtonChecked(m_hWnd, IDC_HACKS_ENABLED));

// The LOWORD returned by UDM_GETPOS automatically restricts the value to its input range.
@@ -403,6 +406,7 @@ void GSSettingsDlg::UpdateControls()
EnableWindow(GetDlgItem(m_hWnd, IDC_SWTHREADS_TEXT), sw);
EnableWindow(GetDlgItem(m_hWnd, IDC_SWTHREADS_EDIT), sw);
EnableWindow(GetDlgItem(m_hWnd, IDC_SWTHREADS), sw);
EnableWindow(GetDlgItem(m_hWnd, IDC_AUTO_FLUSH_SW), sw);

// Hacks
EnableWindow(GetDlgItem(m_hWnd, IDC_HACKS_ENABLED), hw);
@@ -631,7 +635,7 @@ void GSHacksDlg::OnInit()
CheckDlgButton(m_hWnd, IDC_TC_DEPTH, theApp.GetConfigB("UserHacks_DisableDepthSupport"));
CheckDlgButton(m_hWnd, IDC_CPU_FB_CONVERSION, theApp.GetConfigB("UserHacks_CPU_FB_Conversion"));
CheckDlgButton(m_hWnd, IDC_FAST_TC_INV, theApp.GetConfigB("UserHacks_DisablePartialInvalidation"));
CheckDlgButton(m_hWnd, IDC_AUTO_FLUSH, theApp.GetConfigB("UserHacks_AutoFlush"));
CheckDlgButton(m_hWnd, IDC_AUTO_FLUSH_HW, theApp.GetConfigB("UserHacks_AutoFlush"));
CheckDlgButton(m_hWnd, IDC_SAFE_FEATURES, theApp.GetConfigB("UserHacks_Disable_Safe_Features"));
CheckDlgButton(m_hWnd, IDC_MEMORY_WRAPPING, theApp.GetConfigB("wrap_gs_mem"));
CheckDlgButton(m_hWnd, IDC_MERGE_PP_SPRITE, theApp.GetConfigB("UserHacks_merge_pp_sprite"));
@@ -659,7 +663,7 @@ void GSHacksDlg::OnInit()
EnableWindow(GetDlgItem(m_hWnd, IDC_TC_DEPTH), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_CPU_FB_CONVERSION), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_FAST_TC_INV), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_AUTO_FLUSH), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_AUTO_FLUSH_HW), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_SAFE_FEATURES), hwhacks);
EnableWindow(GetDlgItem(m_hWnd, IDC_MEMORY_WRAPPING), hwhacks);

@@ -723,7 +727,7 @@ void GSHacksDlg::OnInit()
AddTooltip(IDC_TC_DEPTH);
AddTooltip(IDC_CPU_FB_CONVERSION);
AddTooltip(IDC_FAST_TC_INV);
AddTooltip(IDC_AUTO_FLUSH);
AddTooltip(IDC_AUTO_FLUSH_HW);
AddTooltip(IDC_SAFE_FEATURES);
AddTooltip(IDC_MEMORY_WRAPPING);
AddTooltip(IDC_TRI_FILTER);
@@ -826,7 +830,7 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
theApp.SetConfig("UserHacks_DisableDepthSupport", (int)IsDlgButtonChecked(m_hWnd, IDC_TC_DEPTH));
theApp.SetConfig("UserHacks_CPU_FB_Conversion", (int)IsDlgButtonChecked(m_hWnd, IDC_CPU_FB_CONVERSION));
theApp.SetConfig("UserHacks_DisablePartialInvalidation", (int)IsDlgButtonChecked(m_hWnd, IDC_FAST_TC_INV));
theApp.SetConfig("UserHacks_AutoFlush", (int)IsDlgButtonChecked(m_hWnd, IDC_AUTO_FLUSH));
theApp.SetConfig("UserHacks_AutoFlush", (int)IsDlgButtonChecked(m_hWnd, IDC_AUTO_FLUSH_HW));
theApp.SetConfig("UserHacks_Disable_Safe_Features", (int)IsDlgButtonChecked(m_hWnd, IDC_SAFE_FEATURES));
theApp.SetConfig("wrap_gs_mem", (int)IsDlgButtonChecked(m_hWnd, IDC_MEMORY_WRAPPING));
theApp.SetConfig("UserHacks_merge_pp_sprite", (int)IsDlgButtonChecked(m_hWnd, IDC_MERGE_PP_SPRITE));
@@ -50,6 +50,7 @@
#define IDC_SWTHREADS_TEXT 2062
#define IDC_SWTHREADS 2063
#define IDC_SWTHREADS_EDIT 2064
#define IDC_AUTO_FLUSH_SW 2065
// PSX:
#define IDD_GPUCONFIG 2070
#define IDC_ASPECTRATIO 2071
@@ -90,7 +91,7 @@
#define IDC_TC_DEPTH 2116
#define IDC_PRELOAD_GS 2117
#define IDC_FAST_TC_INV 2118
#define IDC_AUTO_FLUSH 2119
#define IDC_AUTO_FLUSH_HW 2119
#define IDC_MEMORY_WRAPPING 2120
#define IDC_TRI_FILTER 2121
#define IDC_TRI_FILTER_TEXT 2122

0 comments on commit 5a69a2f

Please sign in to comment.
You can’t perform that action at this time.