summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader_Position.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-06-01 19:58:27 +0200
committerTillmann Karras <tilkax@gmail.com>2015-06-07 12:13:00 +0200
commit5ddd2cef6c5cc8e5414636d73365691de726b3d0 (patch)
tree0fc5652023050ddcccd41598983a233487de8256 /Source/Core/VideoCommon/VertexLoader_Position.cpp
parent9e2f4dd7da306a011d3f34bad7c1808186a9bbd0 (diff)
zfreeze: cache vertex positions
Suggested by degasus.
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader_Position.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader_Position.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp
index ed6b4587b3..fd17fbf4d7 100644
--- a/Source/Core/VideoCommon/VertexLoader_Position.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp
@@ -32,7 +32,12 @@ void LOADERDECL Pos_ReadDirect(VertexLoader* loader)
DataReader src(g_video_buffer_read_ptr, nullptr);
for (int i = 0; i < N; ++i)
- dst.Write(PosScale(src.Read<T>(), scale));
+ {
+ float value = PosScale(src.Read<T>(), scale);
+ if (loader->m_counter < 3)
+ VertexLoaderManager::position_cache[loader->m_counter][i] = value;
+ dst.Write(value);
+ }
g_vertex_manager_write_ptr = dst.GetPointer();
g_video_buffer_read_ptr = src.GetPointer();
@@ -52,7 +57,12 @@ void LOADERDECL Pos_ReadIndex(VertexLoader* loader)
DataReader dst(g_vertex_manager_write_ptr, nullptr);
for (int i = 0; i < N; ++i)
- dst.Write(PosScale(Common::FromBigEndian(data[i]), scale));
+ {
+ float value = PosScale(Common::FromBigEndian(data[i]), scale);
+ if (loader->m_counter < 3)
+ VertexLoaderManager::position_cache[loader->m_counter][i] = value;
+ dst.Write(value);
+ }
g_vertex_manager_write_ptr = dst.GetPointer();
LOG_VTX();