VertexLoader: don't check for possible range

I(index) < std::numeric_limits<I>::max() is always true, so we don't have to check it
This commit is contained in:
degasus 2014-01-16 22:07:48 +01:00
parent 5eae39766b
commit 770485ad04
1 changed files with 10 additions and 16 deletions

View File

@ -90,8 +90,6 @@ void LOADERDECL Pos_ReadIndex()
static_assert(N <= 3, "N > 3 is not sane!"); static_assert(N <= 3, "N > 3 is not sane!");
auto const index = DataRead<I>(); auto const index = DataRead<I>();
if (index < std::numeric_limits<I>::max())
{
auto const data = reinterpret_cast<const T*>(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION])); auto const data = reinterpret_cast<const T*>(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION]));
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
@ -99,7 +97,6 @@ void LOADERDECL Pos_ReadIndex()
LOG_VTX(); LOG_VTX();
} }
}
#if _M_SSE >= 0x301 #if _M_SSE >= 0x301
static const __m128i kMaskSwap32_3 = _mm_set_epi32(0xFFFFFFFFL, 0x08090A0BL, 0x04050607L, 0x00010203L); static const __m128i kMaskSwap32_3 = _mm_set_epi32(0xFFFFFFFFL, 0x08090A0BL, 0x04050607L, 0x00010203L);
@ -109,8 +106,6 @@ template <typename I, bool three>
void LOADERDECL Pos_ReadIndex_Float_SSSE3() void LOADERDECL Pos_ReadIndex_Float_SSSE3()
{ {
auto const index = DataRead<I>(); auto const index = DataRead<I>();
if (index < std::numeric_limits<I>::max())
{
const u32* pData = (const u32 *)(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION])); const u32* pData = (const u32 *)(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION]));
GC_ALIGNED128(const __m128i a = _mm_loadu_si128((__m128i*)pData)); GC_ALIGNED128(const __m128i a = _mm_loadu_si128((__m128i*)pData));
GC_ALIGNED128(__m128i b = _mm_shuffle_epi8(a, three ? kMaskSwap32_3 : kMaskSwap32_2)); GC_ALIGNED128(__m128i b = _mm_shuffle_epi8(a, three ? kMaskSwap32_3 : kMaskSwap32_2));
@ -118,7 +113,6 @@ void LOADERDECL Pos_ReadIndex_Float_SSSE3()
VertexManager::s_pCurBufferPointer += sizeof(float) * 3; VertexManager::s_pCurBufferPointer += sizeof(float) * 3;
LOG_VTX(); LOG_VTX();
} }
}
#endif #endif
static TPipelineFunction tableReadPosition[4][8][2] = { static TPipelineFunction tableReadPosition[4][8][2] = {