Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion capture_service/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ inline constexpr char kUnixAbstractPath[] = "dive_abstract";
inline constexpr char kEnableReplayPm4DumpPropertyName[] = "debug.dive.replay.capture_pm4";
inline constexpr char
kReplayPm4DumpFileNamePropertyName[] = "debug.dive.replay.capture_pm4_file_name";
inline constexpr char kDefaultCaptureFolderName[] = "gfxr_capture";
inline constexpr char kDefaultCaptureFolderName[] = "dive_capture_folder";
inline constexpr char kDefaultReplayFolderName[] = "gfxr_replay_downloads";
inline constexpr char kProfilingPluginFolderName[] = "dive_profiling_plugin";
inline constexpr char kProfilingPluginName[] = "dive_drawcall_metrics";
Expand Down
3 changes: 1 addition & 2 deletions ui/capture_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ void CaptureWorker::run()
emit ErrorMessage(QString::fromStdString(err_msg));
return;
}
std::string download_path = ".";
std::filesystem::path p(*capture_file_path);
std::filesystem::path target_download_path(download_path);
std::filesystem::path target_download_path(m_target_capture_dir);
target_download_path /= p.filename();
qDebug() << "Begin to download the capture file to "
<< target_download_path.generic_string().c_str();
Expand Down
40 changes: 25 additions & 15 deletions ui/trace_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TraceDialog::TraceDialog(ApplicationController &controller, QWidget *parent) :
m_app_type_label = new QLabel(tr("Application Type:"));
m_gfxr_capture_file_on_device_directory_label = new QLabel(
tr("On Device GFXR Capture File Directory Name:"));
m_gfxr_capture_file_local_directory_label = new QLabel(tr("Local GFXR Capture Save Location:"));
QLabel *capture_file_local_directory_label = new QLabel(tr("Local Capture Save Location:"));

m_dev_model = new QStandardItemModel();
m_pkg_model = new QStandardItemModel();
Expand Down Expand Up @@ -209,16 +209,12 @@ TraceDialog::TraceDialog(ApplicationController &controller, QWidget *parent) :
m_gfxr_capture_file_on_device_directory_label->hide();
m_gfxr_capture_file_directory_input_box->hide();

m_gfxr_capture_file_local_directory_layout = new QHBoxLayout();
m_gfxr_capture_file_local_directory_input_box = new QLineEdit();
m_gfxr_capture_file_local_directory_input_box->setPlaceholderText(
QHBoxLayout *capture_file_local_directory_layout = new QHBoxLayout();
m_capture_file_local_directory_input_box = new QLineEdit();
m_capture_file_local_directory_input_box->setPlaceholderText(
"Input the location to save the directory to");
m_gfxr_capture_file_local_directory_layout->addWidget(
m_gfxr_capture_file_local_directory_label);
m_gfxr_capture_file_local_directory_layout->addWidget(
m_gfxr_capture_file_local_directory_input_box);
m_gfxr_capture_file_local_directory_label->hide();
m_gfxr_capture_file_local_directory_input_box->hide();
capture_file_local_directory_layout->addWidget(capture_file_local_directory_label);
capture_file_local_directory_layout->addWidget(m_capture_file_local_directory_input_box);

m_button_layout->addWidget(m_run_button);
m_button_layout->addWidget(m_capture_button);
Expand All @@ -231,7 +227,7 @@ TraceDialog::TraceDialog(ApplicationController &controller, QWidget *parent) :
m_main_layout->addLayout(m_capture_warning_layout);
m_main_layout->addLayout(m_pkg_layout);
m_main_layout->addLayout(m_gfxr_capture_file_directory_layout);
m_main_layout->addLayout(m_gfxr_capture_file_local_directory_layout);
m_main_layout->addLayout(capture_file_local_directory_layout);
m_main_layout->addLayout(m_args_layout);

m_main_layout->addLayout(m_type_layout);
Expand Down Expand Up @@ -714,6 +710,20 @@ void TraceDialog::OnTraceClicked()
progress_bar->setAutoClose(true);
progress_bar->setMinimumDuration(0);
CaptureWorker *workerThread = new CaptureWorker(progress_bar);

if (m_capture_file_local_directory_input_box->text() == "")
{
#if defined(__APPLE__)
m_capture_file_local_directory_input_box->setText(
QDir::homePath() + "/" + QString::fromUtf8(Dive::kDefaultCaptureFolderName));
#else
m_capture_file_local_directory_input_box->setText(
"./" + QString::fromUtf8(Dive::kDefaultCaptureFolderName));
#endif
}

workerThread->SetTargetCaptureDir(
m_capture_file_local_directory_input_box->text().toStdString());
connect(workerThread, &CaptureWorker::CaptureAvailable, this, &TraceDialog::OnTraceAvailable);
connect(workerThread, &CaptureWorker::finished, workerThread, &QObject::deleteLater);
connect(workerThread, &CaptureWorker::ErrorMessage, this, &TraceDialog::ShowErrorMessage);
Expand Down Expand Up @@ -903,13 +913,13 @@ void TraceDialog::RetrieveGfxrCapture()
return;
}

if (m_gfxr_capture_file_local_directory_input_box->text() == "")
if (m_capture_file_local_directory_input_box->text() == "")
{
#if defined(__APPLE__)
m_gfxr_capture_file_local_directory_input_box->setText(
m_capture_file_local_directory_input_box->setText(
QDir::homePath() + "/" + QString::fromUtf8(Dive::kDefaultCaptureFolderName));
#else
m_gfxr_capture_file_local_directory_input_box->setText(
m_capture_file_local_directory_input_box->setText(
"./" + QString::fromUtf8(Dive::kDefaultCaptureFolderName));
#endif
}
Expand All @@ -935,7 +945,7 @@ void TraceDialog::RetrieveGfxrCapture()
workerThread->SetGfxrSourceCaptureDir(on_device_capture_file_directory);

workerThread->SetTargetCaptureDir(
m_gfxr_capture_file_local_directory_input_box->text().toStdString());
m_capture_file_local_directory_input_box->text().toStdString());

connect(workerThread,
&GfxrCaptureWorker::CaptureAvailable,
Expand Down
4 changes: 1 addition & 3 deletions ui/trace_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ private slots:
QLabel *m_gfxr_capture_file_on_device_directory_label;
QLineEdit *m_gfxr_capture_file_directory_input_box;

QHBoxLayout *m_gfxr_capture_file_local_directory_layout;
QLabel *m_gfxr_capture_file_local_directory_label;
QLineEdit *m_gfxr_capture_file_local_directory_input_box;
QLineEdit *m_capture_file_local_directory_input_box;

QVBoxLayout *m_main_layout;
std::vector<Dive::DeviceInfo> m_devices;
Expand Down