| 943 | } |
| 944 | |
| 945 | void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const ReplayOptions &opts, |
| 946 | const QString &origFilename, bool temporary, bool local) |
| 947 | { |
| 948 | m_CaptureFile = origFilename; |
| 949 | m_RemoteFile = captureFile; |
| 950 | |
| 951 | m_CaptureLocal = local; |
| 952 | |
| 953 | Config().Save(); |
| 954 | |
| 955 | m_LoadProgress = 0.0f; |
| 956 | m_PostloadProgress = 0.0f; |
| 957 | |
| 958 | // this function call will block until the capture is either loaded, or there's some failure |
| 959 | m_Replay.OpenCapture(captureFile, opts, [this](float p) { m_LoadProgress = p; }); |
| 960 | |
| 961 | QString filename = QFileInfo(origFilename).fileName(); |
| 962 | |
| 963 | // if the renderer isn't running, we hit a failure case so display an error message |
| 964 | if(!m_Replay.IsRunning()) |
| 965 | { |
| 966 | RDDialog::critical(NULL, tr("Error opening capture"), |
| 967 | tr("Failed to open '%1' for replay\n\n%2") |
| 968 | .arg(filename) |
| 969 | .arg(m_Replay.GetCreateStatus().Message())); |
| 970 | |
| 971 | m_LoadInProgress = false; |
| 972 | return; |
| 973 | } |
| 974 | |
| 975 | if(!temporary) |
| 976 | { |
| 977 | AddRecentFile(Config().RecentCaptureFiles, origFilename); |
| 978 | |
| 979 | Config().Save(); |
| 980 | } |
| 981 | |
| 982 | m_EventID = 0; |
| 983 | |
| 984 | m_FirstAction = m_LastAction = NULL; |
| 985 | |
| 986 | // fetch initial data like actions, textures and buffers |
| 987 | m_Replay.BlockInvoke([this](IReplayController *r) { |
| 988 | if(Config().EventBrowser_AddFake) |
| 989 | r->AddFakeMarkers(); |
| 990 | |
| 991 | m_FrameInfo = r->GetFrameInfo(); |
| 992 | |
| 993 | m_APIProps = r->GetAPIProperties(); |
| 994 | |
| 995 | m_CustomEncodings = r->GetCustomShaderEncodings(); |
| 996 | m_CustomPrefixes = r->GetCustomShaderSourcePrefixes(); |
| 997 | m_TargetEncodings = r->GetTargetShaderEncodings(); |
| 998 | |
| 999 | m_PostloadProgress = 0.2f; |
| 1000 | |
| 1001 | m_Actions = &r->GetRootActions(); |
| 1002 |
nothing calls this directly
no test coverage detected