summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderManager.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/VertexLoaderManager.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/VertexLoaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index 5725a3738a..c37b4a4fa2 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -332,7 +332,7 @@ static void CheckCPConfiguration(int vtx_attr_group)
}
template <bool IsPreprocess>
-int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count, DataReader src)
+int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count, const u8* src)
{
if (count == 0) [[unlikely]]
return 0;
@@ -341,8 +341,6 @@ int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int coun
VertexLoaderBase* loader = RefreshLoader<IsPreprocess>(vtx_attr_group);
int size = count * loader->m_vertex_size;
- if ((int)src.size() < size) [[unlikely]]
- return -1;
if constexpr (!IsPreprocess)
{
@@ -371,7 +369,7 @@ int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int coun
DataReader dst = g_vertex_manager->PrepareForAdditionalData(
primitive, count, loader->m_native_vtx_decl.stride, cullall);
- count = loader->RunVertices(src, dst, count);
+ count = loader->RunVertices(src, dst.GetPointer(), count);
g_vertex_manager->AddIndices(primitive, count);
g_vertex_manager->FlushData(count, loader->m_native_vtx_decl.stride);
@@ -383,9 +381,9 @@ int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int coun
}
template int RunVertices<false>(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count,
- DataReader src);
+ const u8* src);
template int RunVertices<true>(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count,
- DataReader src);
+ const u8* src);
NativeVertexFormat* GetCurrentVertexFormat()
{