diff --git a/GPU/Debugger/Playback.cpp b/GPU/Debugger/Playback.cpp index a05bac1624..8fa93e7d7c 100644 --- a/GPU/Debugger/Playback.cpp +++ b/GPU/Debugger/Playback.cpp @@ -282,8 +282,8 @@ int BufMapping::slabGeneration_ = 0; class DumpExecute { public: - DumpExecute(const std::vector &pushbuf, const std::vector &commands) - : pushbuf_(pushbuf), commands_(commands), mapping_(pushbuf) { + DumpExecute(const std::vector &pushbuf, const std::vector &commands, uint32_t version) + : pushbuf_(pushbuf), commands_(commands), mapping_(pushbuf), version_(version) { } ~DumpExecute(); @@ -320,6 +320,7 @@ private: const std::vector &pushbuf_; const std::vector &commands_; BufMapping mapping_; + uint32_t version_ = 0; }; void DumpExecute::SyncStall() { @@ -564,7 +565,7 @@ void DumpExecute::Framebuf(int level, u32 ptr, u32 sz) { u32 headerSize = (u32)sizeof(FramebufData); u32 pspSize = sz - headerSize; const bool isTarget = (framebuf->flags & 1) != 0; - const bool unchangedVRAM = (framebuf->flags & 2) != 0; + const bool unchangedVRAM = version_ >= 6 && (framebuf->flags & 2) != 0; // TODO: Could use drawnVRAM flag, but it can be wrong. // Could potentially always skip if !isTarget, but playing it safe for offset texture behavior. if (Memory::IsValidRange(framebuf->addr, pspSize) && !unchangedVRAM && (!isTarget || !g_Config.bSoftwareRendering)) { @@ -708,11 +709,14 @@ bool RunMountedReplay(const std::string &filename) { std::lock_guard guard(executeLock); Core_ListenStopRequest(&ReplayStop); + + uint32_t version = 0; if (lastExecFilename != filename) { PROFILE_THIS_SCOPE("ReplayLoad"); u32 fp = pspFileSystem.OpenFile(filename, FILEACCESS_READ); Header header; pspFileSystem.ReadFile(fp, (u8 *)&header, sizeof(header)); + version = header.version; if (memcmp(header.magic, HEADER_MAGIC, sizeof(header.magic)) != 0 || header.version > VERSION || header.version < MIN_VERSION) { ERROR_LOG(SYSTEM, "Invalid GE dump or unsupported version"); @@ -751,7 +755,7 @@ bool RunMountedReplay(const std::string &filename) { lastExecFilename = filename; } - DumpExecute executor(lastExecPushbuf, lastExecCommands); + DumpExecute executor(lastExecPushbuf, lastExecCommands, version); return executor.Run(); } diff --git a/GPU/Debugger/RecordFormat.h b/GPU/Debugger/RecordFormat.h index 22395e1594..8079136d0c 100644 --- a/GPU/Debugger/RecordFormat.h +++ b/GPU/Debugger/RecordFormat.h @@ -34,7 +34,8 @@ static const char *HEADER_MAGIC = "PPSSPPGE"; // Version 3: Adds FRAMEBUF0-FRAMEBUF9 // Version 4: Expanded header with game ID // Version 5: Uses zstd -static const int VERSION = 5; +// Version 6: Corrects dirty VRAM flag +static const int VERSION = 6; static const int MIN_VERSION = 2; enum class CommandType : u8 {