summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader_Position.cpp
diff options
context:
space:
mode:
authorMarkus Wick <markus+github@selfnet.de>2014-12-10 06:53:11 +0100
committerMarkus Wick <markus+github@selfnet.de>2014-12-10 06:53:11 +0100
commit4c139ca7cc816489feffc0b6ee0a3f1a6d85060e (patch)
treee16ae78d1428f5ae62e68541bc8fe46bd3693d34 /Source/Core/VideoCommon/VertexLoader_Position.cpp
parent57d2469d93ca6e2d3e0efe7c0efa85dfb95ed9c0 (diff)
parente88e63adb36d649903a54740d9580a491cd6bf0d (diff)
Merge pull request #1609 from degasus/datareader
VideoCommon: Datareader
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader_Position.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader_Position.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp
index 6c50dd1560..60a6115ee0 100644
--- a/Source/Core/VideoCommon/VertexLoader_Position.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp
@@ -13,7 +13,7 @@
#include "VideoCommon/VideoCommon.h"
// Thoughts on the implementation of a vertex loader compiler.
-// s_pCurBufferPointer should definitely be in a register.
+// g_vertex_manager_write_ptr should definitely be in a register.
// Could load the position scale factor in XMM7, for example.
// The pointer inside DataReadU8 in another.
@@ -75,12 +75,14 @@ void LOADERDECL Pos_ReadDirect()
{
static_assert(N <= 3, "N > 3 is not sane!");
auto const scale = posScale[0];
- DataWriter dst;
- DataReader src;
+ DataReader dst(g_vertex_manager_write_ptr, nullptr);
+ DataReader src(g_video_buffer_read_ptr, nullptr);
for (int i = 0; i < 3; ++i)
dst.Write(i<N ? PosScale(src.Read<T>(), scale) : 0.f);
+ dst.WritePointer(&g_vertex_manager_write_ptr);
+ src.WritePointer(&g_video_buffer_read_ptr);
LOG_VTX();
}
@@ -93,11 +95,12 @@ void LOADERDECL Pos_ReadIndex()
auto const index = DataRead<I>();
auto const data = reinterpret_cast<const T*>(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION]));
auto const scale = posScale[0];
- DataWriter dst;
+ DataReader dst(g_vertex_manager_write_ptr, nullptr);
for (int i = 0; i < 3; ++i)
dst.Write(i<N ? PosScale(Common::FromBigEndian(data[i]), scale) : 0.f);
+ dst.WritePointer(&g_vertex_manager_write_ptr);
LOG_VTX();
}