diff options
| author | Tilka <tilkax@gmail.com> | 2024-04-12 20:01:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-12 20:01:09 +0100 |
| commit | 2011c7a4483942cb4001ac7edd584914670e5c33 (patch) | |
| tree | a7aa3e3e1598fec5cdbfcef9c79b7f787ca99f1f /Source/Core/VideoCommon/XFStructs.cpp | |
| parent | 9a9be5ca5154c07a6c4e9235b7e685f1f7d1eae2 (diff) | |
| parent | 54773bc5d2c847bc4e070a8a647b97a9fc76bcb0 (diff) | |
Merge pull request #12697 from JosJuice/no-getpointer-part-4
VideoCommon: Remove calls to GetPointer
Diffstat (limited to 'Source/Core/VideoCommon/XFStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/XFStructs.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp index 906c37bb5a..33f47a01a5 100644 --- a/Source/Core/VideoCommon/XFStructs.cpp +++ b/Source/Core/VideoCommon/XFStructs.cpp @@ -259,19 +259,21 @@ void LoadIndexedXF(CPArray array, u32 index, u16 address, u8 size) { // load stuff from array to address in xf mem - u32* currData = (u32*)(&xfmem) + address; + const u32 buf_size = size * sizeof(u32); + u32* currData = reinterpret_cast<u32*>(&xfmem) + address; u32* newData; auto& system = Core::System::GetInstance(); auto& fifo = system.GetFifo(); if (fifo.UseDeterministicGPUThread()) { - newData = (u32*)fifo.PopFifoAuxBuffer(size * sizeof(u32)); + newData = reinterpret_cast<u32*>(fifo.PopFifoAuxBuffer(buf_size)); } else { auto& memory = system.GetMemory(); - newData = (u32*)memory.GetPointer(g_main_cp_state.array_bases[array] + - g_main_cp_state.array_strides[array] * index); + newData = reinterpret_cast<u32*>(memory.GetPointerForRange( + g_main_cp_state.array_bases[array] + g_main_cp_state.array_strides[array] * index, + buf_size)); } auto& xf_state_manager = system.GetXFStateManager(); @@ -294,12 +296,14 @@ void LoadIndexedXF(CPArray array, u32 index, u16 address, u8 size) void PreprocessIndexedXF(CPArray array, u32 index, u16 address, u8 size) { + const size_t buf_size = size * sizeof(u32); + auto& system = Core::System::GetInstance(); auto& memory = system.GetMemory(); - const u8* new_data = memory.GetPointer(g_preprocess_cp_state.array_bases[array] + - g_preprocess_cp_state.array_strides[array] * index); + const u8* new_data = memory.GetPointerForRange( + g_preprocess_cp_state.array_bases[array] + g_preprocess_cp_state.array_strides[array] * index, + buf_size); - const size_t buf_size = size * sizeof(u32); system.GetFifo().PushFifoAuxBuffer(new_data, buf_size); } |
