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/VertexLoaderManager.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp') 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 -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(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(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count, - DataReader src); + const u8* src); template int RunVertices(int vtx_attr_group, OpcodeDecoder::Primitive primitive, int count, - DataReader src); + const u8* src); NativeVertexFormat* GetCurrentVertexFormat() { -- cgit v1.2.3