gsdx-ogl: add a new hack to force anisotropic filtering

By default, anisotropic filtering was disabled when textures aren't countinuous.
This hack allows to force it. It can help to reduce aliasing but it would create
unexpected effect on texture boundaries.

Again, someone ought to add the option on Windows too
This commit is contained in:
Gregory Hainaut 2016-04-10 13:48:05 +02:00
parent 9e6cb79f4e
commit 53690cf9d0
5 changed files with 14 additions and 6 deletions

View File

@ -339,6 +339,7 @@ void populate_hack_table(GtkWidget* hack_table)
GtkWidget* hack_safe_fbmask = CreateCheckBox("Safe Accurate Blending", "UserHacks_safe_fbmask");
GtkWidget* hack_fast_inv = CreateCheckBox("Fast Texture Invalidation", "UserHacks_DisablePartialInvalidation");
GtkWidget* hack_depth_check = CreateCheckBox("Disable Depth Emulation", "UserHacks_DisableDepthSupport");
GtkWidget* hack_force_aniso = CreateCheckBox("Force Anisotropic Filtering", "UserHacks_ForceAniso");
GtkWidget* hack_sprite_box = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_SpriteHack");
GtkWidget* hack_sprite_label = left_label("Alpha-Sprite Hack:");
@ -360,6 +361,7 @@ void populate_hack_table(GtkWidget* hack_table)
AddTooltip(hack_safe_fbmask, IDC_SAFE_FBMASK);
AddTooltip(hack_fast_inv, IDC_FAST_TC_INV);
AddTooltip(hack_depth_check, IDC_TC_DEPTH);
AddTooltip(hack_force_aniso, IDC_FORCE_ANISO);
s_table_line = 0;
@ -367,7 +369,7 @@ void populate_hack_table(GtkWidget* hack_table)
InsertWidgetInTable(hack_table , hack_wild_check , align_sprite_check);
InsertWidgetInTable(hack_table , hack_offset_check , preload_gs_check);
InsertWidgetInTable(hack_table , hack_safe_fbmask , hack_fast_inv);
InsertWidgetInTable(hack_table , hack_depth_check);
InsertWidgetInTable(hack_table , hack_depth_check , hack_force_aniso);
InsertWidgetInTable(hack_table , hack_sprite_label , hack_sprite_box );
InsertWidgetInTable(hack_table , stretch_hack_label , stretch_hack_box );
InsertWidgetInTable(hack_table , hack_skipdraw_label , hack_skipdraw_spin);

View File

@ -27,9 +27,10 @@
GSRendererOGL::GSRendererOGL()
: GSRendererHW(new GSTextureCacheOGL(this))
{
m_accurate_date = theApp.GetConfig("accurate_date", 0);
m_accurate_date = theApp.GetConfig("accurate_date", 0);
m_sw_blending = theApp.GetConfig("accurate_blending_unit", 1);
m_sw_blending = theApp.GetConfig("accurate_blending_unit", 1);
m_force_aniso = theApp.GetConfig("UserHacks", 0) && theApp.GetConfig("UserHacks_ForceAniso", 0);
// Hope nothing requires too many draw calls.
m_drawlist.reserve(2048);
@ -987,7 +988,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
ps_ssel.tau = (m_context->CLAMP.WMS != CLAMP_CLAMP);
ps_ssel.tav = (m_context->CLAMP.WMT != CLAMP_CLAMP);
ps_ssel.ltf = bilinear && simple_sample;
ps_ssel.aniso = simple_sample;
ps_ssel.aniso = simple_sample || (m_force_aniso && !tex->m_palette);
// Setup Texture ressources
dev->SetupSampler(ps_ssel);

View File

@ -46,9 +46,10 @@ class GSRendererOGL final : public GSRendererHW
private:
bool m_accurate_date;
int m_sw_blending;
PRIM_OVERLAP m_prim_overlap;
int m_sw_blending;
bool m_force_aniso;
bool m_unsafe_fbmask;
PRIM_OVERLAP m_prim_overlap;
vector<size_t> m_drawlist;
unsigned int UserHacks_TCOffset;

View File

@ -137,6 +137,9 @@ const char* dialog_message(int ID, bool* updateText) {
case IDC_FAST_TC_INV:
return "By default, the texture cache handles partial invalidations. Unfortunately it is very costly to compute CPU wise."
"\n\nThis hack replaces the partial invalidation with a complete deletion of the texture to reduce the CPU load.\n\nIt helps snowblind engine game.";
case IDC_FORCE_ANISO:
return "Force Anisotropic filtering even when it will be mathematically incorrect.\n"
"It helps to remove aliasing but it can create glitches around texture boundaries";
#endif
default:
if (updateText)

View File

@ -74,5 +74,6 @@ enum {
IDC_MIPMAP,
IDC_PRELOAD_GS,
IDC_FAST_TC_INV,
IDC_FORCE_ANISO,
};
#endif