fix stutter. need cleanup

This commit is contained in:
r2dliu 2020-11-24 01:31:48 -05:00
commit e842065405
5 changed files with 50 additions and 16 deletions

1
.gitignore vendored
View file

@ -6,6 +6,7 @@ Thumbs.db
Source/Core/Common/scmrev.h
# Ignore files output by build
/[Bb]uild*/
/out/
/[Bb]inary*/
/obj/
# Ignore files output by Android cmake build

View file

@ -1,4 +1,4 @@
{
{
"configurations": [
{
"name": "Release",
@ -11,7 +11,8 @@
"variables": [
{
"name": "Qt5_DIR",
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_64\\lib\\cmake\\Qt5"
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_64\\lib\\cmake\\Qt5",
"type": "STRING"
}
]
},
@ -26,7 +27,8 @@
"variables": [
{
"name": "Qt5_DIR",
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_64\\lib\\cmake\\Qt5"
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_64\\lib\\cmake\\Qt5",
"type": "STRING"
}
]
},
@ -41,15 +43,18 @@
"variables": [
{
"name": "Qt5_DIR",
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_arm64\\lib\\cmake\\Qt5"
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_arm64\\lib\\cmake\\Qt5",
"type": "STRING"
},
{
"name": "CMAKE_SYSTEM_NAME",
"value": "Windows"
"value": "Windows",
"type": "STRING"
},
{
"name": "CMAKE_SYSTEM_PROCESSOR",
"value": "aarch64"
"value": "aarch64",
"type": "STRING"
}
]
},
@ -64,17 +69,32 @@
"variables": [
{
"name": "Qt5_DIR",
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_arm64\\lib\\cmake\\Qt5"
"value": "${workspaceRoot}\\Externals\\Qt\\Qt5.14.1\\msvc2019_arm64\\lib\\cmake\\Qt5",
"type": "STRING"
},
{
"name": "CMAKE_SYSTEM_NAME",
"value": "Windows"
"value": "Windows",
"type": "STRING"
},
{
"name": "CMAKE_SYSTEM_PROCESSOR",
"value": "aarch64"
}
]
"value": "aarch64",
"type": "STRING"
}
]
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
}
]
}

View file

@ -118,6 +118,7 @@ void SlippiPlaybackStatus::processInitialState()
{
INFO_LOG(SLIPPI, "saving iState");
State::SaveToBuffer(iState);
State::SaveToBuffer(cState);
SConfig::GetInstance().bHideCursor = false;
};
@ -266,9 +267,14 @@ void SlippiPlaybackStatus::loadState(s32 closestStateFrame)
std::string stateString;
decoder.Decode((char*)iState.data(), iState.size(), futureDiffs[closestStateFrame].get(), &stateString);
std::vector<u8> stateToLoad(stateString.begin(), stateString.end());
if (stateToLoad.size() == 0) {
std::cout << "wtf break" << std::endl;
}
else {
State::LoadFromBuffer(stateToLoad);
}
}
}
bool SlippiPlaybackStatus::shouldFFWFrame(s32 frameIndex) const
{

View file

@ -25,6 +25,8 @@
#include "Common/Timer.h"
#include "Common/Version.h"
#include "Common/Logging/Log.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
@ -192,8 +194,8 @@ static void DoState(PointerWrap& p)
// Movie must be done before the video backend, because the window is redrawn in the video backend
// state load, and the frame number must be up-to-date.
Movie::DoState(p);
p.DoMarker("Movie");
// Movie::DoState(p);
// p.DoMarker("Movie");
// Begin with video backend, so that it gets a chance to clear its caches and writeback modified
// things to RAM
@ -214,9 +216,9 @@ static void DoState(PointerWrap& p)
Gecko::DoState(p);
p.DoMarker("Gecko");
#if defined(HAVE_FFMPEG)
FrameDump::DoState();
#endif
//#if defined(HAVE_FFMPEG)
// FrameDump::DoState();
//#endif
}
void LoadFromBuffer(std::vector<u8>& buffer)
@ -240,16 +242,17 @@ void SaveToBuffer(std::vector<u8>& buffer)
{
Core::RunOnCPUThread(
[&] {
INFO_LOG(SLIPPI, "at start of save to buffer call");
u8* ptr = nullptr;
PointerWrap p(&ptr, PointerWrap::MODE_MEASURE);
DoState(p);
const size_t buffer_size = reinterpret_cast<size_t>(ptr);
buffer.resize(buffer_size);
ptr = &buffer[0];
p.SetMode(PointerWrap::MODE_WRITE);
DoState(p);
INFO_LOG(SLIPPI, "at end of save to buffer call");
},
true);
}

View file

@ -264,6 +264,9 @@ void VideoBackendBase::PopulateBackendInfoFromUI()
void VideoBackendBase::DoState(PointerWrap& p)
{
#ifdef IS_PLAYBACK
VideoCommon_DoState(p);
#else
if (!SConfig::GetInstance().bCPUThread)
{
VideoCommon_DoState(p);
@ -278,6 +281,7 @@ void VideoBackendBase::DoState(PointerWrap& p)
// Let the GPU thread sleep after loading the state, so we're not spinning if paused after loading
// a state. The next GP burst will wake it up again.
Fifo::GpuMaySleep();
#endif
}
void VideoBackendBase::InitializeShared()