mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Swap SSE4.1 instruction with an SSE2 instruction
The min spec is SSSE3, using SSE4.1 instructions (_mm_extract_epi64) will break compatibility. The code containing the defect is debug only, and %90+ of the user base uses an SSE4.1 capable processor.
This commit is contained in:
parent
f2058c9ecd
commit
c1c01d2302
@ -138,7 +138,10 @@ void CAI_Utility::DrawAIScriptNetwork(
|
|||||||
int nNearest = GetNearestNodeToPos(pNetwork, &pScriptNode->m_vOrigin);
|
int nNearest = GetNearestNodeToPos(pNetwork, &pScriptNode->m_vOrigin);
|
||||||
if (nNearest != NO_NODE) // NO_NODE = -1
|
if (nNearest != NO_NODE) // NO_NODE = -1
|
||||||
{
|
{
|
||||||
auto p = uLinkSet.insert(_mm_extract_epi64(PackNodeLink(i, nNearest), 1));
|
shortx8 packedLinks = PackNodeLink(i, nNearest);
|
||||||
|
packedLinks = _mm_srli_si128(packedLinks, 8); // Only the upper 64bits are used.
|
||||||
|
|
||||||
|
auto p = uLinkSet.insert(reinterpret_cast<int64_t&>(packedLinks));
|
||||||
if (p.second) // Only render if link hasn't already been rendered.
|
if (p.second) // Only render if link hasn't already been rendered.
|
||||||
{
|
{
|
||||||
const CAI_ScriptNode* pNearestNode = &pNetwork->m_ScriptNode[nNearest];
|
const CAI_ScriptNode* pNearestNode = &pNetwork->m_ScriptNode[nNearest];
|
||||||
@ -536,9 +539,9 @@ void CAI_Utility::DrawNavMeshPolyBoundaries(const dtNavMesh* pMesh,
|
|||||||
// d -
|
// d -
|
||||||
// Output : packed node set as i64x2
|
// Output : packed node set as i64x2
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
__m128i CAI_Utility::PackNodeLink(int32_t a, int32_t b, int32_t c, int32_t d) const
|
shortx8 CAI_Utility::PackNodeLink(int32_t a, int32_t b, int32_t c, int32_t d) const
|
||||||
{
|
{
|
||||||
__m128i xResult = _mm_set_epi32(a, b, c, d);
|
shortx8 xResult = _mm_set_epi32(a, b, c, d);
|
||||||
|
|
||||||
// We shuffle a b and c d if following condition is met, this is to
|
// We shuffle a b and c d if following condition is met, this is to
|
||||||
// ensure we always end up with one possible combination of indices.
|
// ensure we always end up with one possible combination of indices.
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
const int nTileRange,
|
const int nTileRange,
|
||||||
const bool bDepthBuffer) const;
|
const bool bDepthBuffer) const;
|
||||||
|
|
||||||
__m128i PackNodeLink(int32_t a, int32_t b, int32_t c = 0, int32_t d = 0) const;
|
shortx8 PackNodeLink(int32_t a, int32_t b, int32_t c = 0, int32_t d = 0) const;
|
||||||
int GetNearestNodeToPos(const CAI_Network* pAINetwork, const Vector3D* vec) const;
|
int GetNearestNodeToPos(const CAI_Network* pAINetwork, const Vector3D* vec) const;
|
||||||
bool IsTileWithinRange(const dtMeshTile* pTile, const VPlane& vPlane, const Vector3D& vCamera, const float flCameraRadius) const;
|
bool IsTileWithinRange(const dtMeshTile* pTile, const VPlane& vPlane, const Vector3D& vCamera, const float flCameraRadius) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user