gsdx: Defer vector initialisation to GS/GPUinit

It can cause PCSX2 to crash if the instructions aren't supported.
This commit is contained in:
Jonathan Li committed 2016-07-27 23:34:14 +01:00
1 parent d726d4d4aa
commit e5ea4cc5d4
24 files changed
+502 -274

No files matched your search

+43 -25
View File
@@ -44,37 +44,55 @@ alignas(8) const uint8 GSDrawScanlineCodeGenerator::m_test[16][8] =
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
};
const GSVector8 GSDrawScanlineCodeGenerator::m_log2_coef[4] =
GSVector8 GSDrawScanlineCodeGenerator::m_log2_coef[4];
#else
GSVector4i GSDrawScanlineCodeGenerator::m_test[8];
GSVector4 GSDrawScanlineCodeGenerator::m_log2_coef[4];
#endif
void GSDrawScanlineCodeGenerator::InitVectors()
{
GSVector8(0.204446009836232697516f),
GSVector8(-1.04913055217340124191f),
GSVector8(2.28330284476918490682f),
GSVector8(1.0f),
};
#if _M_SSE >= 0x501
GSVector8 log2_coef[4] =
{
GSVector8(0.204446009836232697516f),
GSVector8(-1.04913055217340124191f),
GSVector8(2.28330284476918490682f),
GSVector8(1.0f),
};
for (size_t n = 0; n < countof(log2_coef); ++n)
m_log2_coef[n] = log2_coef[n];
#else
GSVector4i test[8] =
{
GSVector4i::zero(),
GSVector4i(0xffffffff, 0x00000000, 0x00000000, 0x00000000),
GSVector4i(0xffffffff, 0xffffffff, 0x00000000, 0x00000000),
GSVector4i(0xffffffff, 0xffffffff, 0xffffffff, 0x00000000),
GSVector4i(0x00000000, 0xffffffff, 0xffffffff, 0xffffffff),
GSVector4i(0x00000000, 0x00000000, 0xffffffff, 0xffffffff),
GSVector4i(0x00000000, 0x00000000, 0x00000000, 0xffffffff),
GSVector4i::zero(),
};
const GSVector4i GSDrawScanlineCodeGenerator::m_test[8] =
{
GSVector4i::zero(),
GSVector4i(0xffffffff, 0x00000000, 0x00000000, 0x00000000),
GSVector4i(0xffffffff, 0xffffffff, 0x00000000, 0x00000000),
GSVector4i(0xffffffff, 0xffffffff, 0xffffffff, 0x00000000),
GSVector4i(0x00000000, 0xffffffff, 0xffffffff, 0xffffffff),
GSVector4i(0x00000000, 0x00000000, 0xffffffff, 0xffffffff),
GSVector4i(0x00000000, 0x00000000, 0x00000000, 0xffffffff),
GSVector4i::zero(),
};
GSVector4 log2_coef[4] =
{
GSVector4(0.204446009836232697516f),
GSVector4(-1.04913055217340124191f),
GSVector4(2.28330284476918490682f),
GSVector4(1.0f),
};
const GSVector4 GSDrawScanlineCodeGenerator::m_log2_coef[4] =
{
GSVector4(0.204446009836232697516f),
GSVector4(-1.04913055217340124191f),
GSVector4(2.28330284476918490682f),
GSVector4(1.0f),
};
for (size_t n = 0; n < countof(test); ++n)
m_test[n] = test[n];
for (size_t n = 0; n < countof(log2_coef); ++n)
m_log2_coef[n] = log2_coef[n];
#endif
}
GSDrawScanlineCodeGenerator::GSDrawScanlineCodeGenerator(void* param, uint64 key, void* code, size_t maxsize)
: GSCodeGenerator(code, maxsize)
@@ -354,4 +372,4 @@ void GSDrawScanlineCodeGenerator::blend8r(const Xmm& b, const Xmm& a)
#endif
}
#endif
#endif