gsdx-ogl: enable multithread driver by default for nvidia

+ add a linux gui option to disable it (for test purpose)
This commit is contained in:
Gregory Hainaut 2015-05-16 15:22:20 +02:00
parent c567198967
commit 8a73849531
3 changed files with 15 additions and 1 deletions

View File

@ -191,6 +191,13 @@ EXPORT_C GSclose()
static int _GSopen(void** dsp, char* title, int renderer, int threads = -1) static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
{ {
// I really don't know the impact on windows! It could work
#ifdef __linux__
if (theApp.GetConfig("enable_nvidia_multi_thread", 1)) {
setenv("__GL_THREADED_OPTIMIZATIONS", "1", 0);
}
#endif
GSDevice* dev = NULL; GSDevice* dev = NULL;
if(renderer == -1) if(renderer == -1)

View File

@ -292,16 +292,20 @@ void populate_hw_table(GtkWidget* hw_table)
GtkWidget* acc_blend_check = CreateCheckBox("Accurate Blend", "accurate_blend", false); GtkWidget* acc_blend_check = CreateCheckBox("Accurate Blend", "accurate_blend", false);
GtkWidget* acc_date_check = CreateCheckBox("Accurate Date", "accurate_date", false); GtkWidget* acc_date_check = CreateCheckBox("Accurate Date", "accurate_date", false);
GtkWidget* MT_nvidia_check = CreateCheckBox("Nvidia Multi-Thread support", "enable_nvidia_multi_thread", true);
// Some helper string // Some helper string
gtk_widget_set_tooltip_text(paltex_check, dialog_message(IDC_PALTEX)); gtk_widget_set_tooltip_text(paltex_check, dialog_message(IDC_PALTEX));
gtk_widget_set_tooltip_text(acc_blend_check, dialog_message(IDC_ACCURATE_BLEND)); gtk_widget_set_tooltip_text(acc_blend_check, dialog_message(IDC_ACCURATE_BLEND));
gtk_widget_set_tooltip_text(acc_date_check, dialog_message(IDC_ACCURATE_DATE)); gtk_widget_set_tooltip_text(acc_date_check, dialog_message(IDC_ACCURATE_DATE));
gtk_widget_set_tooltip_text(MT_nvidia_check, "Huge speedup on Nvidia binary driver! No effect otherwise.");
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); InsertWidgetInTable(hw_table, paltex_check);
InsertWidgetInTable(hw_table, acc_blend_check, acc_date_check); InsertWidgetInTable(hw_table, acc_blend_check, acc_date_check);
InsertWidgetInTable(hw_table, MT_nvidia_check);
} }
void populate_gl_table(GtkWidget* gl_table) void populate_gl_table(GtkWidget* gl_table)

View File

@ -63,7 +63,10 @@ namespace PboPool {
// will use DMA CACHED memory as the source for buffer object operations // will use DMA CACHED memory as the source for buffer object operations
void Init() { void Init() {
gl_GenBuffers(countof(m_pool), m_pool); gl_GenBuffers(countof(m_pool), m_pool);
m_texture_storage = (theApp.GetConfig("ogl_texture_storage", !GLLoader::fglrx_buggy_driver) == 1) && GLLoader::found_GL_ARB_buffer_storage; m_texture_storage = GLLoader::found_GL_ARB_buffer_storage;
// Code is really faster on MT driver. So far only nvidia support it
if (!(GLLoader::nvidia_buggy_driver && theApp.GetConfig("enable_nvidia_multi_thread", 1)))
m_texture_storage &= (theApp.GetConfig("ogl_texture_storage", 0) == 1);
for (size_t i = 0; i < countof(m_pool); i++) { for (size_t i = 0; i < countof(m_pool); i++) {
BindPbo(); BindPbo();