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/VertexLoader.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 8176027b45..bc97ac041d 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -6,7 +6,6 @@ #include "Common/Assert.h" #include "Common/CommonTypes.h" -#include "VideoCommon/DataReader.h" #include "VideoCommon/VertexLoaderManager.h" #include "VideoCommon/VertexLoaderUtils.h" #include "VideoCommon/VertexLoader_Color.h" @@ -16,7 +15,7 @@ #include "VideoCommon/VideoCommon.h" // This pointer is used as the source/dst for all fixed function loader calls -u8* g_video_buffer_read_ptr; +const u8* g_video_buffer_read_ptr; u8* g_vertex_manager_write_ptr; static void PosMtx_ReadDirect_UByte(VertexLoader* loader) @@ -249,10 +248,10 @@ void VertexLoader::WriteCall(TPipelineFunction func) m_PipelineStages[m_numPipelineStages++] = func; } -int VertexLoader::RunVertices(DataReader src, DataReader dst, int count) +int VertexLoader::RunVertices(const u8* src, u8* dst, int count) { - g_vertex_manager_write_ptr = dst.GetPointer(); - g_video_buffer_read_ptr = src.GetPointer(); + g_vertex_manager_write_ptr = dst; + g_video_buffer_read_ptr = src; m_numLoadedVertices += count; m_skippedVertices = 0; -- cgit v1.2.3 From e13094766d51c970deb2a00800e4dd033af25665 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Tue, 22 Nov 2022 17:49:49 -0800 Subject: Fix VertexLoader.cpp using the wrong size for texture matrix indices without a corresponding texture This regressed in 0a906f553fe7699d1c863a464211f74b6c306a0f, I think (though I haven't confirmed it). Mario Tennis and Luigi's Mansion both use these for some reason (as far as I can tell, the data isn't actually used; it's just extra data included for no reason) --- Source/Core/VideoCommon/VertexLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/VertexLoader.cpp') diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index bc97ac041d..c2d3c1bd29 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -221,7 +221,7 @@ void VertexLoader::CompileVertexTranslator() WriteCall(VertexLoader_TextCoord::GetDummyFunction()); // important to get indices right! break; } - else if (m_VtxDesc.low.TexMatIdx[i]) + else if (m_VtxDesc.low.TexMatIdx[j]) { has_more = true; } -- cgit v1.2.3