pcsx2: Auto select proper GSdx plugin in Plugin Selection. (#3013)

In order AVX2 -> SSE4 -> SSE2.
Auto selected by cpu instruction support.
This commit is contained in:
KrossX 2019-07-12 18:48:20 -03:00 committed by lightningterror
parent a3f3e7705d
commit c678627b19
1 changed files with 25 additions and 1 deletions

View File

@ -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 );