summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader_Position.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2014-01-16 22:07:48 +0100
committerdegasus <wickmarkus@web.de>2014-01-16 22:07:48 +0100
commit770485ad04185c93ea18b8bf86e56569d1fb8f37 (patch)
treed11d199f7a172ff18f3ff4c214caad2607516540 /Source/Core/VideoCommon/VertexLoader_Position.cpp
parent5eae39766b011b40be6e8caab79e445b9dd3bd15 (diff)
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
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader_Position.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader_Position.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp
index da844484ad..3206c002a9 100644
--- a/Source/Core/VideoCommon/VertexLoader_Position.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp
@@ -90,15 +90,12 @@ void LOADERDECL Pos_ReadIndex()
static_assert(N <= 3, "N > 3 is not sane!");
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)
- DataWrite(i<N ? PosScale(Common::FromBigEndian(data[i])) : 0.f);
+ for (int i = 0; i < 3; ++i)
+ DataWrite(i<N ? PosScale(Common::FromBigEndian(data[i])) : 0.f);
- LOG_VTX();
- }
+ LOG_VTX();
}
#if _M_SSE >= 0x301
@@ -109,15 +106,12 @@ template <typename I, bool three>
void LOADERDECL Pos_ReadIndex_Float_SSSE3()
{
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]));
- GC_ALIGNED128(const __m128i a = _mm_loadu_si128((__m128i*)pData));
- GC_ALIGNED128(__m128i b = _mm_shuffle_epi8(a, three ? kMaskSwap32_3 : kMaskSwap32_2));
- _mm_storeu_si128((__m128i*)VertexManager::s_pCurBufferPointer, b);
- VertexManager::s_pCurBufferPointer += sizeof(float) * 3;
- LOG_VTX();
- }
+ 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(__m128i b = _mm_shuffle_epi8(a, three ? kMaskSwap32_3 : kMaskSwap32_2));
+ _mm_storeu_si128((__m128i*)VertexManager::s_pCurBufferPointer, b);
+ VertexManager::s_pCurBufferPointer += sizeof(float) * 3;
+ LOG_VTX();
}
#endif