From 21970c4a2a728669687a687f61a8f7453319dd54 Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 27 Nov 2014 23:53:11 +0100 Subject: VideoCommon: cleanup OpcodeDecoder --- Source/Core/VideoCommon/VertexLoader.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 3f7161b8f7..dfdefd42eb 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -45,6 +45,9 @@ int colElements[2]; GC_ALIGNED128(float posScale[4]); GC_ALIGNED64(float tcScale[8][2]); +// This pointer is used as the source for all fixed function loader calls +u8* g_video_buffer_read_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), -- cgit v1.2.3 From 02cdb41d3d3eec73d2c843fe865ff906e01b44a4 Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 9 Dec 2014 08:30:38 +0100 Subject: VideoCommon: Rename s_pCurBufferPointer --- Source/Core/VideoCommon/VertexLoader.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index dfdefd42eb..e767f46638 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -45,8 +45,9 @@ int colElements[2]; GC_ALIGNED128(float posScale[4]); GC_ALIGNED64(float tcScale[8][2]); -// This pointer is used as the source for all fixed function loader calls +// 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), @@ -96,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); @@ -492,8 +493,10 @@ void VertexLoader::ConvertVertices ( int count ) void VertexLoader::RunVertices(const VAT& vat, int primitive, int const count) { + g_vertex_manager_write_ptr = g_vertex_manager->s_pCurBufferPointer; SetupRunVertices(vat, primitive, count); ConvertVertices(count); + g_vertex_manager->s_pCurBufferPointer = g_vertex_manager_write_ptr; } void VertexLoader::SetVAT(const VAT& vat) -- cgit v1.2.3 From 3fc7e55cc4623c1c49efb4c317ab0202499bb5fd Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 9 Dec 2014 08:35:04 +0100 Subject: VideoCommon: clean up VertexLoader --- Source/Core/VideoCommon/VertexLoader.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index e767f46638..f293564e85 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -491,12 +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) { - g_vertex_manager_write_ptr = g_vertex_manager->s_pCurBufferPointer; + dst.WritePointer(&g_vertex_manager_write_ptr); + src.WritePointer(&g_video_buffer_read_ptr); SetupRunVertices(vat, primitive, count); ConvertVertices(count); - g_vertex_manager->s_pCurBufferPointer = g_vertex_manager_write_ptr; + return count; } void VertexLoader::SetVAT(const VAT& vat) -- cgit v1.2.3