gsdx: defer init of GSUtil global object

Close #1935
This commit is contained in:
Gregory Hainaut 2017-05-19 10:41:49 +02:00
parent e043822a93
commit 5c7d9d08e2
3 changed files with 10 additions and 1 deletions

View File

@ -128,6 +128,7 @@ EXPORT_C_(int) GSinit()
// const type qualifier from all the affected variables.
theApp.Init();
GSUtil::Init();
GSBlock::InitVectors();
GSClut::InitVectors();
#ifdef ENABLE_OPENCL

View File

@ -102,7 +102,8 @@ public:
uint32 CompatibleBitsField[64][2];
uint32 SharedBitsField[64][2];
GSUtilMaps()
// Defer init to avoid AVX2 illegal instructions
void Init()
{
PrimClassField[GS_POINTLIST] = GS_POINT_CLASS;
PrimClassField[GS_LINELIST] = GS_LINE_CLASS;
@ -163,6 +164,11 @@ public:
} s_maps;
void GSUtil::Init()
{
s_maps.Init();
}
GS_PRIM_CLASS GSUtil::GetPrimClass(uint32 prim)
{
return (GS_PRIM_CLASS)s_maps.PrimClassField[prim];

View File

@ -37,6 +37,8 @@ struct OCLDeviceDesc
class GSUtil
{
public:
static void Init();
static const char* GetLibName();
static GS_PRIM_CLASS GetPrimClass(uint32 prim);