From c678627b1975a29c395cdceb7e0e0f2a3c908308 Mon Sep 17 00:00:00 2001 From: KrossX Date: Fri, 12 Jul 2019 18:48:20 -0300 Subject: [PATCH] pcsx2: Auto select proper GSdx plugin in Plugin Selection. (#3013) In order AVX2 -> SSE4 -> SSE2. Auto selected by cpu instruction support. --- pcsx2/gui/Panels/PluginSelectorPanel.cpp | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/Panels/PluginSelectorPanel.cpp b/pcsx2/gui/Panels/PluginSelectorPanel.cpp index 997c6e701a..308cfdf0f9 100644 --- a/pcsx2/gui/Panels/PluginSelectorPanel.cpp +++ b/pcsx2/gui/Panels/PluginSelectorPanel.cpp @@ -677,7 +677,31 @@ void Panels::PluginSelectorPanel::OnEnumComplete( wxCommandEvent& evt ) else if( m_ComponentBoxes->Get(pid).GetSelection() == wxNOT_FOUND ) { - m_ComponentBoxes->Get(pid).SetSelection( 0 ); + if( pid == PluginId_GS ) + { + int count = (int)m_ComponentBoxes->Get(pid).GetCount(); + + int index_avx2 = -1; + int index_sse4 = -1; + int index_sse2 = -1; + + for( int i = 0; i < count; i++ ) + { + auto str = m_ComponentBoxes->Get(pid).GetString( i ); + + if( x86caps.hasAVX2 && str.Contains("AVX2") ) index_avx2 = i; + if( x86caps.hasStreamingSIMD4Extensions && str.Contains("SSE4") ) index_sse4 = i; + if( str.Contains("SSE2") ) index_sse2 = i; + } + + if( index_avx2 >= 0 ) m_ComponentBoxes->Get(pid).SetSelection( index_avx2 ); + else if( index_sse4 >= 0 ) m_ComponentBoxes->Get(pid).SetSelection( index_sse4 ); + else if( index_sse2 >= 0 ) m_ComponentBoxes->Get(pid).SetSelection( index_sse2 ); + else m_ComponentBoxes->Get(pid).SetSelection( 0 ); + } + else + m_ComponentBoxes->Get(pid).SetSelection( 0 ); + m_ComponentBoxes->GetConfigButton(pid).Enable( !CorePlugins.AreLoaded() ); } } while( ++pi, pi->shortname != NULL );