summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderManager.cpp
diff options
context:
space:
mode:
authorMai <mathew1800@gmail.com>2022-12-07 00:52:31 +0000
committerGitHub <noreply@github.com>2022-12-07 00:52:31 +0000
commit94faad0d3727876f507577655d771d1f978b2f4a (patch)
treed43be9b3cc0bfdd24143a2a5d195ea8d065afe95 /Source/Core/VideoCommon/VertexLoaderManager.cpp
parent2a23aab25418fc4587b7a8480283b68a9d13eeb9 (diff)
parent839db591d9daa388c1b6eb944a9f34a9aa41c871 (diff)
Merge pull request #11320 from AdmiralCurtiss/globals-memory
HW/Memmap: Refactor Memory to class, move to Core::System.
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index c37b4a4fa2..e788f8e3db 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -18,6 +18,7 @@
#include "Core/DolphinAnalytics.h"
#include "Core/HW/Memmap.h"
+#include "Core/System.h"
#include "VideoCommon/BPMemory.h"
#include "VideoCommon/CPMemory.h"
@@ -81,6 +82,9 @@ void UpdateVertexArrayPointers()
if (!g_bases_dirty) [[likely]]
return;
+ auto& system = Core::System::GetInstance();
+ auto& memory = system.GetMemory();
+
// Some games such as Burnout 2 can put invalid addresses into
// the array base registers. (see issue 8591)
// But the vertex arrays with invalid addresses aren't actually enabled.
@@ -89,24 +93,24 @@ void UpdateVertexArrayPointers()
// We also only update the array base if the vertex description states we are going to use it.
if (IsIndexed(g_main_cp_state.vtx_desc.low.Position))
cached_arraybases[CPArray::Position] =
- Memory::GetPointer(g_main_cp_state.array_bases[CPArray::Position]);
+ memory.GetPointer(g_main_cp_state.array_bases[CPArray::Position]);
if (IsIndexed(g_main_cp_state.vtx_desc.low.Normal))
cached_arraybases[CPArray::Normal] =
- Memory::GetPointer(g_main_cp_state.array_bases[CPArray::Normal]);
+ memory.GetPointer(g_main_cp_state.array_bases[CPArray::Normal]);
for (u8 i = 0; i < g_main_cp_state.vtx_desc.low.Color.Size(); i++)
{
if (IsIndexed(g_main_cp_state.vtx_desc.low.Color[i]))
cached_arraybases[CPArray::Color0 + i] =
- Memory::GetPointer(g_main_cp_state.array_bases[CPArray::Color0 + i]);
+ memory.GetPointer(g_main_cp_state.array_bases[CPArray::Color0 + i]);
}
for (u8 i = 0; i < g_main_cp_state.vtx_desc.high.TexCoord.Size(); i++)
{
if (IsIndexed(g_main_cp_state.vtx_desc.high.TexCoord[i]))
cached_arraybases[CPArray::TexCoord0 + i] =
- Memory::GetPointer(g_main_cp_state.array_bases[CPArray::TexCoord0 + i]);
+ memory.GetPointer(g_main_cp_state.array_bases[CPArray::TexCoord0 + i]);
}
g_bases_dirty = false;