FifoPlayer: Save/restore texture memory state for fifo logs
This commit is contained in:
parent
438989668e
commit
5f3c878ba2
|
@ -25,6 +25,10 @@
|
|||
#include "VideoCommon/BPMemory.h"
|
||||
#include "VideoCommon/CommandProcessor.h"
|
||||
|
||||
// We need to include TextureDecoder.h for the texMem array.
|
||||
// TODO: Move texMem somewhere else so this isn't an issue.
|
||||
#include "VideoCommon/TextureDecoder.h"
|
||||
|
||||
bool IsPlayingBackFifologWithBrokenEFBCopies = false;
|
||||
|
||||
FifoPlayer::~FifoPlayer()
|
||||
|
@ -127,6 +131,7 @@ int FifoPlayer::AdvanceFrame()
|
|||
// GPU is the same for each playback loop.
|
||||
m_CurrentFrame = m_FrameRangeStart;
|
||||
LoadRegisters();
|
||||
LoadTextureMemory();
|
||||
FlushWGP();
|
||||
}
|
||||
|
||||
|
@ -420,6 +425,7 @@ void FifoPlayer::LoadMemory()
|
|||
|
||||
SetupFifo();
|
||||
LoadRegisters();
|
||||
LoadTextureMemory();
|
||||
FlushWGP();
|
||||
}
|
||||
|
||||
|
@ -460,6 +466,13 @@ void FifoPlayer::LoadRegisters()
|
|||
LoadXFReg(i, regs[i]);
|
||||
}
|
||||
|
||||
void FifoPlayer::LoadTextureMemory()
|
||||
{
|
||||
static_assert(static_cast<size_t>(TMEM_SIZE) == static_cast<size_t>(FifoDataFile::TEX_MEM_SIZE),
|
||||
"TMEM_SIZE matches the size of texture memory in FifoDataFile");
|
||||
std::memcpy(texMem, m_File->GetTexMem(), FifoDataFile::TEX_MEM_SIZE);
|
||||
}
|
||||
|
||||
void FifoPlayer::WriteCP(u32 address, u16 value)
|
||||
{
|
||||
PowerPC::Write_U16(value, 0xCC000000 | address);
|
||||
|
|
|
@ -111,6 +111,7 @@ private:
|
|||
|
||||
void LoadMemory();
|
||||
void LoadRegisters();
|
||||
void LoadTextureMemory();
|
||||
|
||||
void WriteCP(u32 address, u16 value);
|
||||
void WritePI(u32 address, u32 value);
|
||||
|
|
|
@ -183,7 +183,7 @@ void FifoRecorder::EndFrame(u32 fifoStart, u32 fifoEnd)
|
|||
}
|
||||
|
||||
void FifoRecorder::SetVideoMemory(const u32* bpMem, const u32* cpMem, const u32* xfMem,
|
||||
const u32* xfRegs, u32 xfRegsSize)
|
||||
const u32* xfRegs, u32 xfRegsSize, const u8* texMem)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lk(sMutex);
|
||||
|
||||
|
@ -195,6 +195,8 @@ void FifoRecorder::SetVideoMemory(const u32* bpMem, const u32* cpMem, const u32*
|
|||
|
||||
u32 xfRegsCopySize = std::min((u32)FifoDataFile::XF_REGS_SIZE, xfRegsSize);
|
||||
memcpy(m_File->GetXFRegs(), xfRegs, xfRegsCopySize * 4);
|
||||
|
||||
memcpy(m_File->GetTexMem(), texMem, FifoDataFile::TEX_MEM_SIZE);
|
||||
}
|
||||
|
||||
FifoRecordAnalyzer::Initialize(cpMem);
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
// bpMem must point to the actual bp mem array used by the plugin because it will be read as fifo
|
||||
// data is recorded
|
||||
void SetVideoMemory(const u32* bpMem, const u32* cpMem, const u32* xfMem, const u32* xfRegs,
|
||||
u32 xfRegsSize);
|
||||
u32 xfRegsSize, const u8* texMem);
|
||||
|
||||
// Checked once per frame prior to callng EndFrame()
|
||||
bool IsRecording() const { return m_IsRecording; }
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include "VideoCommon/RenderBase.h"
|
||||
#include "VideoCommon/Statistics.h"
|
||||
#include "VideoCommon/TextureCacheBase.h"
|
||||
#include "VideoCommon/TextureDecoder.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
#include "VideoCommon/XFMemory.h"
|
||||
|
||||
|
@ -678,7 +679,8 @@ void Renderer::RecordVideoMemory()
|
|||
|
||||
FillCPMemoryArray(cpmem);
|
||||
|
||||
FifoRecorder::GetInstance().SetVideoMemory(bpmem_ptr, cpmem, xfmem_ptr, xfregs_ptr, xfregs_size);
|
||||
FifoRecorder::GetInstance().SetVideoMemory(bpmem_ptr, cpmem, xfmem_ptr, xfregs_ptr, xfregs_size,
|
||||
texMem);
|
||||
}
|
||||
|
||||
void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc,
|
||||
|
|
Loading…
Reference in New Issue