diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-06-07 16:44:40 -0400 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-06-07 16:44:40 -0400 |
| commit | 588de63f9cc27ea0398f2d28802b1baf7ebcdb95 (patch) | |
| tree | 6ed98304af2ecf7a923ca5959d03c07a57c4e28c /Source/Core/VideoCommon/VertexLoader_Position.cpp | |
| parent | 82fa01804c37e2a39383730bd72cda47a54a6a61 (diff) | |
| parent | 10bd68936c11ae0ed74861ca2172d41bbac0dc1f (diff) | |
Merge pull request #2141 from Tilka/position_cache
zfreeze: cache vertex positions
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader_Position.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoader_Position.cpp | 14 |
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(); |
