From 0bcd3c79bb4bbd90fb1f8d02adb26198690709fb Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Tue, 22 Nov 2022 16:54:05 -0800 Subject: VertexLoader: Eliminate use of DataReader DataReader is generally jank - it has a start and end pointer, but the end pointer is generally not used, and all of the vertex loaders mostly bypassed it anyways. Wrapper code (the vertex loaer test, as well as Fifo.cpp and OpcodeDecoding.cpp) still uses it, as does the software vertex loader (which is not a subclass of VertexLoader). These can probably be eliminated later. --- Source/Core/VideoCommon/VertexLoaderBase.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoaderBase.cpp') diff --git a/Source/Core/VideoCommon/VertexLoaderBase.cpp b/Source/Core/VideoCommon/VertexLoaderBase.cpp index bf4e364147..0ed8fc6439 100644 --- a/Source/Core/VideoCommon/VertexLoaderBase.cpp +++ b/Source/Core/VideoCommon/VertexLoaderBase.cpp @@ -17,7 +17,6 @@ #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" -#include "VideoCommon/DataReader.h" #include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoader_Color.h" #include "VideoCommon/VertexLoader_Normal.h" @@ -57,15 +56,13 @@ public: b->m_vertex_size, b->m_native_components, b->m_native_vtx_decl.stride); } } - int RunVertices(DataReader src, DataReader dst, int count) override + int RunVertices(const u8* src, u8* dst, int count) override { buffer_a.resize(count * a->m_native_vtx_decl.stride + 4); buffer_b.resize(count * b->m_native_vtx_decl.stride + 4); - int count_a = - a->RunVertices(src, DataReader(buffer_a.data(), buffer_a.data() + buffer_a.size()), count); - int count_b = - b->RunVertices(src, DataReader(buffer_b.data(), buffer_b.data() + buffer_b.size()), count); + int count_a = a->RunVertices(src, buffer_a.data(), count); + int count_b = b->RunVertices(src, buffer_b.data(), count); if (count_a != count_b) { @@ -84,7 +81,7 @@ public: m_VtxDesc, m_VtxAttr); } - memcpy(dst.GetPointer(), buffer_a.data(), count_a * m_native_vtx_decl.stride); + memcpy(dst, buffer_a.data(), count_a * m_native_vtx_decl.stride); m_numLoadedVertices += count; return count_a; } @@ -162,7 +159,7 @@ std::unique_ptr VertexLoaderBase::CreateVertexLoader(const TVt { std::unique_ptr loader = nullptr; - //#define COMPARE_VERTEXLOADERS + // #define COMPARE_VERTEXLOADERS #if defined(_M_X86_64) loader = std::make_unique(vtx_desc, vtx_attr); -- cgit v1.2.3