summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderBase.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2022-11-22 16:54:05 -0800
committerPokechu22 <Pokechu022@gmail.com>2022-11-22 17:17:11 -0800
commit0bcd3c79bb4bbd90fb1f8d02adb26198690709fb (patch)
tree22ec9e15aca405a0b4621ff51d1ff51f9c179f3e /Source/Core/VideoCommon/VertexLoaderBase.cpp
parent8ac8d5afb63f65a1bed1a5d089d9fbbd5b8553b4 (diff)
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.
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderBase.cpp13
1 files changed, 5 insertions, 8 deletions
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> VertexLoaderBase::CreateVertexLoader(const TVt
{
std::unique_ptr<VertexLoaderBase> loader = nullptr;
- //#define COMPARE_VERTEXLOADERS
+ // #define COMPARE_VERTEXLOADERS
#if defined(_M_X86_64)
loader = std::make_unique<VertexLoaderX64>(vtx_desc, vtx_attr);