summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoader.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.cpp
parent57d2469d93ca6e2d3e0efe7c0efa85dfb95ed9c0 (diff)
parente88e63adb36d649903a54740d9580a491cd6bf0d (diff)
Merge pull request #1609 from degasus/datareader
VideoCommon: Datareader
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoader.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp
index 3f7161b8f7..f293564e85 100644
--- a/Source/Core/VideoCommon/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/VertexLoader.cpp
@@ -45,6 +45,10 @@ int colElements[2];
GC_ALIGNED128(float posScale[4]);
GC_ALIGNED64(float tcScale[8][2]);
+// This pointer is used as the source/dst for all fixed function loader calls
+u8* g_video_buffer_read_ptr;
+u8* g_vertex_manager_write_ptr;
+
static const float fractionTable[32] = {
1.0f / (1U << 0), 1.0f / (1U << 1), 1.0f / (1U << 2), 1.0f / (1U << 3),
1.0f / (1U << 4), 1.0f / (1U << 5), 1.0f / (1U << 6), 1.0f / (1U << 7),
@@ -93,8 +97,8 @@ static void LOADERDECL TexMtx_Write_Float4()
{
#if _M_SSE >= 0x200
__m128 output = _mm_cvtsi32_ss(_mm_castsi128_ps(_mm_setzero_si128()), s_curtexmtx[s_texmtxwrite++]);
- _mm_storeu_ps((float*)VertexManager::s_pCurBufferPointer, _mm_shuffle_ps(output, output, 0x45 /* 1, 1, 0, 1 */));
- VertexManager::s_pCurBufferPointer += sizeof(float) * 4;
+ _mm_storeu_ps((float*)g_vertex_manager_write_ptr, _mm_shuffle_ps(output, output, 0x45 /* 1, 1, 0, 1 */));
+ g_vertex_manager_write_ptr += sizeof(float) * 4;
#else
DataWrite(0.f);
DataWrite(0.f);
@@ -487,10 +491,13 @@ void VertexLoader::ConvertVertices ( int count )
#endif
}
-void VertexLoader::RunVertices(const VAT& vat, int primitive, int const count)
+int VertexLoader::RunVertices(const VAT& vat, int primitive, int count, DataReader src, DataReader dst)
{
+ dst.WritePointer(&g_vertex_manager_write_ptr);
+ src.WritePointer(&g_video_buffer_read_ptr);
SetupRunVertices(vat, primitive, count);
ConvertVertices(count);
+ return count;
}
void VertexLoader::SetVAT(const VAT& vat)