gsdx-ogl: add 2 options in the GUI to ease testing

accurate_date => use an emulated stencil to compute destination alpha
    test (could be slow)

accurate_blend => do nothing (future)
This commit is contained in:
Gregory Hainaut 2015-05-08 10:40:43 +02:00
parent 4c91bab00e
commit b490085214
4 changed files with 30 additions and 12 deletions

View File

@ -447,9 +447,8 @@ namespace GLLoader {
// GL4.2 // GL4.2
if (ext.compare("GL_ARB_shading_language_420pack") == 0) found_GL_ARB_shading_language_420pack = true; if (ext.compare("GL_ARB_shading_language_420pack") == 0) found_GL_ARB_shading_language_420pack = true;
if (ext.compare("GL_ARB_texture_storage") == 0) found_GL_ARB_texture_storage = true; if (ext.compare("GL_ARB_texture_storage") == 0) found_GL_ARB_texture_storage = true;
// Only enable this extension on nvidia // (I'm not sure AMD supports correctly GL_ARB_shader_image_load_store
// It is too costly on perf (big upscaling), code need to updated to reduce the number of draw stage if (ext.compare("GL_ARB_shader_image_load_store") == 0) found_GL_ARB_shader_image_load_store = true;
//if (nvidia_buggy_driver && ext.compare("GL_ARB_shader_image_load_store") == 0) found_GL_ARB_shader_image_load_store = true;
// GL4.3 // GL4.3
if (ext.compare("GL_ARB_copy_image") == 0) found_GL_ARB_copy_image = true; if (ext.compare("GL_ARB_copy_image") == 0) found_GL_ARB_copy_image = true;
if (ext.compare("GL_ARB_explicit_uniform_location") == 0) found_GL_ARB_explicit_uniform_location = true; if (ext.compare("GL_ARB_explicit_uniform_location") == 0) found_GL_ARB_explicit_uniform_location = true;

View File

@ -290,11 +290,14 @@ void populate_hw_table(GtkWidget* hw_table)
GtkWidget* paltex_check = CreateCheckBox("Allow 8 bits textures", "paltex"); GtkWidget* paltex_check = CreateCheckBox("Allow 8 bits textures", "paltex");
GtkWidget* fba_check = CreateCheckBox("Alpha correction (FBA)", "fba", true); GtkWidget* fba_check = CreateCheckBox("Alpha correction (FBA)", "fba", true);
GtkWidget* acc_blend_check = CreateCheckBox("Accurate Blend", "accurate_blend", false);
GtkWidget* acc_date_check = CreateCheckBox("Accurate Date", "accurate_date", false);
s_table_line = 0; s_table_line = 0;
InsertWidgetInTable(hw_table, filter_label, filter_combo_box); InsertWidgetInTable(hw_table, filter_label, filter_combo_box);
InsertWidgetInTable(hw_table, af_label, af_combo_box); InsertWidgetInTable(hw_table, af_label, af_combo_box);
InsertWidgetInTable(hw_table, paltex_check, fba_check); InsertWidgetInTable(hw_table, paltex_check, fba_check);
InsertWidgetInTable(hw_table, acc_blend_check, acc_date_check);
} }
void populate_gl_table(GtkWidget* gl_table) void populate_gl_table(GtkWidget* gl_table)

View File

@ -27,16 +27,29 @@
GSRendererOGL::GSRendererOGL() GSRendererOGL::GSRendererOGL()
: GSRendererHW(new GSTextureCacheOGL(this)) : GSRendererHW(new GSTextureCacheOGL(this))
{ {
m_fba = !!theApp.GetConfig("fba", 1); m_fba = theApp.GetConfig("fba", 1);
UserHacks_AlphaHack = !!theApp.GetConfig("UserHacks_AlphaHack", 0) && !!theApp.GetConfig("UserHacks", 0);
UserHacks_AlphaStencil = !!theApp.GetConfig("UserHacks_AlphaStencil", 0) && !!theApp.GetConfig("UserHacks", 0);
UserHacks_DateGL4 = !!theApp.GetConfig("UserHacks_DateGL4", 0);
m_pixelcenter = GSVector2(-0.5f, -0.5f); m_pixelcenter = GSVector2(-0.5f, -0.5f);
UserHacks_Unscale_sprite = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_UnscaleSprite", 0) : 0;
UserHacks_TCOffset = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_TCOffset", 0) : 0; m_accurate_blend = theApp.GetConfig("accurate_blend", 0);
UserHacks_TCO_x = (UserHacks_TCOffset & 0xFFFF) / -1000.0f; m_accurate_date = theApp.GetConfig("accurate_date", 0);
UserHacks_TCO_y = ((UserHacks_TCOffset >> 16) & 0xFFFF) / -1000.0f;
UserHacks_AlphaHack = theApp.GetConfig("UserHacks_AlphaHack", 0);
UserHacks_AlphaStencil = theApp.GetConfig("UserHacks_AlphaStencil", 0);
UserHacks_DateGL4 = theApp.GetConfig("UserHacks_DateGL4", 0);
UserHacks_Unscale_sprite = theApp.GetConfig("UserHacks_UnscaleSprite", 0);
UserHacks_TCOffset = theApp.GetConfig("UserHacks_TCOffset", 0);
UserHacks_TCO_x = (UserHacks_TCOffset & 0xFFFF) / -1000.0f;
UserHacks_TCO_y = ((UserHacks_TCOffset >> 16) & 0xFFFF) / -1000.0f;
if (!theApp.GetConfig("UserHacks", 0)) {
UserHacks_AlphaHack = false;
UserHacks_AlphaStencil = false;
UserHacks_DateGL4 = false;
UserHacks_Unscale_sprite = 0;
UserHacks_TCOffset = 0;
UserHacks_TCO_x = 0;
UserHacks_TCO_y = 0;
}
} }
bool GSRendererOGL::CreateDevice(GSDevice* dev) bool GSRendererOGL::CreateDevice(GSDevice* dev)
@ -246,7 +259,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
DATE_GL45 = true; DATE_GL45 = true;
DATE = false; DATE = false;
} else if (om_csel.wa && (!context->TEST.ATE || context->TEST.ATST == ATST_ALWAYS)) { } else if (om_csel.wa && (!context->TEST.ATE || context->TEST.ATST == ATST_ALWAYS)) {
DATE_GL42 = GLLoader::found_GL_ARB_shader_image_load_store && !UserHacks_AlphaStencil; DATE_GL42 = m_accurate_date && GLLoader::found_GL_ARB_shader_image_load_store && !UserHacks_AlphaStencil;
} }
} }

View File

@ -32,6 +32,9 @@ class GSRendererOGL : public GSRendererHW
private: private:
GSVector2 m_pixelcenter; GSVector2 m_pixelcenter;
bool m_fba; bool m_fba;
bool m_accurate_blend;
bool m_accurate_date;
bool UserHacks_AlphaHack; bool UserHacks_AlphaHack;
bool UserHacks_AlphaStencil; bool UserHacks_AlphaStencil;
bool UserHacks_DateGL4; bool UserHacks_DateGL4;