summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader_Position.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2014-01-21 18:54:16 +0100
committerdegasus <wickmarkus@web.de>2014-01-21 18:54:16 +0100
commitc613868f5788b59855ff564440a12839717aa3d2 (patch)
tree39dfa4ebc6afece4b4cee45f123ae61e1cdd66cc /Source/Core/VideoCommon/VertexLoader_Position.cpp
parentf90fe903203781d1732a706f7b84e0a5699a682f (diff)
VertexLoader: load scale factor as const, this will save some assembler instructions
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader_Position.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader_Position.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp
index 3206c002a9..e6836ddf6a 100644
--- a/Source/Core/VideoCommon/VertexLoader_Position.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp
@@ -61,13 +61,13 @@ MOVUPS(MOffset(EDI, 0), XMM0);
*/
template <typename T>
-float PosScale(T val)
+float PosScale(T val, float scale)
{
- return val * posScale;
+ return val * scale;
}
template <>
-float PosScale(float val)
+float PosScale(float val, float scale)
{
return val;
}
@@ -76,9 +76,10 @@ template <typename T, int N>
void LOADERDECL Pos_ReadDirect()
{
static_assert(N <= 3, "N > 3 is not sane!");
+ auto const scale = posScale;
for (int i = 0; i < 3; ++i)
- DataWrite(i<N ? PosScale(DataRead<T>()) : 0.f);
+ DataWrite(i<N ? PosScale(DataRead<T>(), scale) : 0.f);
LOG_VTX();
}
@@ -91,9 +92,10 @@ void LOADERDECL Pos_ReadIndex()
auto const index = DataRead<I>();
auto const data = reinterpret_cast<const T*>(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION]));
+ auto const scale = posScale;
for (int i = 0; i < 3; ++i)
- DataWrite(i<N ? PosScale(Common::FromBigEndian(data[i])) : 0.f);
+ DataWrite(i<N ? PosScale(Common::FromBigEndian(data[i]), scale) : 0.f);
LOG_VTX();
}