mirror of https://github.com/PCSX2/pcsx2.git
gsdx:psx: Fix illegal instruction crash on old CPUs
Check the instruction set first in GPUinit, GPUconfigure and GPUtext to prevent unsupported vector instructions from being executed. Move the vector initialisation in GPUinit to a separate function - it avoids a vzeroupper instruction.
This commit is contained in:
parent
7e30d16797
commit
44f90efb93
|
@ -57,10 +57,8 @@ EXPORT_C_(uint32) PSEgetLibVersion()
|
||||||
return version << 16 | revision << 8 | PLUGIN_VERSION;
|
return version << 16 | revision << 8 | PLUGIN_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUinit()
|
static void InitVectors()
|
||||||
{
|
{
|
||||||
theApp.Init();
|
|
||||||
|
|
||||||
GSVector4i::InitVectors();
|
GSVector4i::InitVectors();
|
||||||
GSVector4::InitVectors();
|
GSVector4::InitVectors();
|
||||||
#if _M_SSE >= 0x500
|
#if _M_SSE >= 0x500
|
||||||
|
@ -73,6 +71,18 @@ EXPORT_C_(int32) GPUinit()
|
||||||
GPUDrawScanlineCodeGenerator::InitVectors();
|
GPUDrawScanlineCodeGenerator::InitVectors();
|
||||||
GPULocalMemory::InitVectors();
|
GPULocalMemory::InitVectors();
|
||||||
GPUSetupPrimCodeGenerator::InitVectors();
|
GPUSetupPrimCodeGenerator::InitVectors();
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPORT_C_(int32) GPUinit()
|
||||||
|
{
|
||||||
|
if(!GSUtil::CheckSSE())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
theApp.Init();
|
||||||
|
|
||||||
|
InitVectors();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -155,6 +165,11 @@ EXPORT_C_(int32) GPUopen(void* hWnd)
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUconfigure()
|
EXPORT_C_(int32) GPUconfigure()
|
||||||
{
|
{
|
||||||
|
if(!GSUtil::CheckSSE())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
theApp.Init();
|
theApp.Init();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -177,6 +192,11 @@ EXPORT_C_(int32) GPUconfigure()
|
||||||
|
|
||||||
EXPORT_C_(int32) GPUtest()
|
EXPORT_C_(int32) GPUtest()
|
||||||
{
|
{
|
||||||
|
if(!GSUtil::CheckSSE())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue