mirror of https://github.com/PCSX2/pcsx2.git
gsdx: Defer GSdxApp initialisation on Linux only
vector push_back causes a SIGILL signal on a Nehalem (SSE4.2) QEMU VM when compiled with GCC 6.1.1. However, an empty constructor causes illegal instruction exceptions to be generated on a Windows VM. So here's an inbetween that looks stupid but works on what I've tested.
This commit is contained in:
parent
9f53987e3b
commit
46ba9aa117
|
@ -127,6 +127,8 @@ EXPORT_C_(int) GSinit()
|
||||||
// can crash if the CPU does not support the instruction set.
|
// can crash if the CPU does not support the instruction set.
|
||||||
// Initialise it here instead - it's not ideal since we have to strip the
|
// Initialise it here instead - it's not ideal since we have to strip the
|
||||||
// const type qualifier from all the affected variables.
|
// const type qualifier from all the affected variables.
|
||||||
|
theApp.Init();
|
||||||
|
|
||||||
GSBlock::InitVectors();
|
GSBlock::InitVectors();
|
||||||
GSClut::InitVectors();
|
GSClut::InitVectors();
|
||||||
GSDrawScanlineCodeGenerator::InitVectors();
|
GSDrawScanlineCodeGenerator::InitVectors();
|
||||||
|
@ -815,6 +817,8 @@ EXPORT_C GSconfigure()
|
||||||
{
|
{
|
||||||
if(!GSUtil::CheckSSE()) return;
|
if(!GSUtil::CheckSSE()) return;
|
||||||
|
|
||||||
|
theApp.Init();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
GSDialog::InitCommonControls();
|
GSDialog::InitCommonControls();
|
||||||
if(GSSettingsDlg().DoModal() == IDOK)
|
if(GSSettingsDlg().DoModal() == IDOK)
|
||||||
|
|
|
@ -127,6 +127,21 @@ GSdxApp theApp;
|
||||||
|
|
||||||
GSdxApp::GSdxApp()
|
GSdxApp::GSdxApp()
|
||||||
{
|
{
|
||||||
|
// Empty constructor causes an illegal instruction exception on an SSE4.2 machine on Windows.
|
||||||
|
// Non-empty doesn't, but raises a SIGILL signal when compiled against GCC 6.1.1.
|
||||||
|
// So here's a compromise.
|
||||||
|
#ifdef _WIN32
|
||||||
|
Init();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void GSdxApp::Init()
|
||||||
|
{
|
||||||
|
static bool is_initialised = false;
|
||||||
|
if (is_initialised)
|
||||||
|
return;
|
||||||
|
is_initialised = true;
|
||||||
|
|
||||||
m_ini = "inis/GSdx.ini";
|
m_ini = "inis/GSdx.ini";
|
||||||
m_section = "Settings";
|
m_section = "Settings";
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,8 @@ class GSdxApp
|
||||||
public:
|
public:
|
||||||
GSdxApp();
|
GSdxApp();
|
||||||
|
|
||||||
void* GetModuleHandlePtr();
|
void Init();
|
||||||
|
void* GetModuleHandlePtr();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HMODULE GetModuleHandle() {return (HMODULE)GetModuleHandlePtr();}
|
HMODULE GetModuleHandle() {return (HMODULE)GetModuleHandlePtr();}
|
||||||
|
|
|
@ -59,6 +59,8 @@ EXPORT_C_(uint32) PSEgetLibVersion()
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUinit()
|
EXPORT_C_(int32) GPUinit()
|
||||||
{
|
{
|
||||||
|
theApp.Init();
|
||||||
|
|
||||||
GSVector4i::InitVectors();
|
GSVector4i::InitVectors();
|
||||||
GSVector4::InitVectors();
|
GSVector4::InitVectors();
|
||||||
#if _M_SSE >= 0x500
|
#if _M_SSE >= 0x500
|
||||||
|
@ -153,6 +155,8 @@ EXPORT_C_(int32) GPUopen(void* hWnd)
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUconfigure()
|
EXPORT_C_(int32) GPUconfigure()
|
||||||
{
|
{
|
||||||
|
theApp.Init();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
GPUSettingsDlg dlg;
|
GPUSettingsDlg dlg;
|
||||||
|
|
Loading…
Reference in New Issue