diff options
| author | comex <comexk@gmail.com> | 2014-09-28 21:59:27 -0400 |
|---|---|---|
| committer | comex <comexk@gmail.com> | 2014-09-28 21:59:27 -0400 |
| commit | fbabc03b3f684d57cc25bd8b86c0b1d30a237bb8 (patch) | |
| tree | 64695c3c67d9f975b7e1c7835e0e405620a562e9 /Source/Core/VideoCommon/BPStructs.cpp | |
| parent | 431fb4d82a9fa9597df3c35c27e55714ff3e27c0 (diff) | |
| parent | 6c0a68d50765c24a205f7133205b54c26ae1bbfb (diff) | |
Merge pull request #885 from comex/gpu-determinism
GPU determinism (apparently it is ready for merge)
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPStructs.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 308badae6e..152d15a7d5 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -173,7 +173,8 @@ static void BPWritten(const BPCmd& bp) switch (bp.newvalue & 0xFF) { case 0x02: - PixelEngine::SetFinish(); // may generate interrupt + if (!g_use_deterministic_gpu_thread) + PixelEngine::SetFinish(); // may generate interrupt DEBUG_LOG(VIDEO, "GXSetDrawDone SetPEFinish (value: 0x%02X)", (bp.newvalue & 0xFFFF)); return; @@ -183,11 +184,13 @@ static void BPWritten(const BPCmd& bp) } return; case BPMEM_PE_TOKEN_ID: // Pixel Engine Token ID - PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), false); + if (!g_use_deterministic_gpu_thread) + PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), false); DEBUG_LOG(VIDEO, "SetPEToken 0x%04x", (bp.newvalue & 0xFFFF)); return; case BPMEM_PE_TOKEN_INT_ID: // Pixel Engine Interrupt Token ID - PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), true); + if (!g_use_deterministic_gpu_thread) + PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), true); DEBUG_LOG(VIDEO, "SetPEToken + INT 0x%04x", (bp.newvalue & 0xFFFF)); return; @@ -685,6 +688,26 @@ void LoadBPReg(u32 value0) BPWritten(bp); } +void LoadBPRegPreprocess(u32 value0) +{ + int regNum = value0 >> 24; + // masking could hypothetically be a problem + u32 newval = value0 & 0xffffff; + switch (regNum) + { + case BPMEM_SETDRAWDONE: + if ((newval & 0xff) == 0x02) + PixelEngine::SetFinish(); + break; + case BPMEM_PE_TOKEN_ID: + PixelEngine::SetToken(newval & 0xffff, false); + break; + case BPMEM_PE_TOKEN_INT_ID: // Pixel Engine Interrupt Token ID + PixelEngine::SetToken(newval & 0xffff, true); + break; + } +} + void GetBPRegInfo(const u8* data, std::string* name, std::string* desc) { const char* no_yes[2] = { "No", "Yes" }; |
