diff --git a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp
index e500387e3..e106e2467 100644
--- a/qrenderdoc/Windows/Dialogs/LiveCapture.cpp
+++ b/qrenderdoc/Windows/Dialogs/LiveCapture.cpp
@@ -125,8 +125,8 @@ LiveCapture::LiveCapture(ICaptureContext &ctx, const QString &hostname, const QS
ui->target->setText(QString());
- ui->captureProgressLabel->setVisible(false);
- ui->captureProgress->setVisible(false);
+ ui->progressLabel->setVisible(false);
+ ui->progressBar->setVisible(false);
ui->captures->setItemDelegate(new NameEditOnlyDelegate(this));
@@ -1140,7 +1140,23 @@ void LiveCapture::connectionThreadEntry()
return;
}
- TargetControlMessage msg = m_Connection->ReceiveMessage();
+ TargetControlMessage msg = m_Connection->ReceiveMessage([this](float progress) {
+ GUIInvoke::call(this, [this, progress]() {
+ if(progress >= 0.0f && progress < 1.0f)
+ {
+ ui->progressLabel->setText(tr("Copy in Progress:"));
+ ui->progressLabel->setVisible(true);
+ ui->progressBar->setVisible(true);
+ ui->progressBar->setMaximum(1000);
+ ui->progressBar->setValue(1000 * progress);
+ }
+ else
+ {
+ ui->progressLabel->setVisible(false);
+ ui->progressBar->setVisible(false);
+ }
+ });
+ });
if(msg.type == TargetControlMessageType::RegisterAPI)
{
@@ -1168,15 +1184,16 @@ void LiveCapture::connectionThreadEntry()
if(progress >= 0.0f && progress < 1.0f)
{
- ui->captureProgressLabel->setVisible(true);
- ui->captureProgress->setVisible(true);
- ui->captureProgress->setMaximum(1000);
- ui->captureProgress->setValue(1000 * progress);
+ ui->progressLabel->setText(tr("Capture in Progress:"));
+ ui->progressLabel->setVisible(true);
+ ui->progressBar->setVisible(true);
+ ui->progressBar->setMaximum(1000);
+ ui->progressBar->setValue(1000 * progress);
}
else
{
- ui->captureProgressLabel->setVisible(false);
- ui->captureProgress->setVisible(false);
+ ui->progressLabel->setVisible(false);
+ ui->progressBar->setVisible(false);
}
});
diff --git a/qrenderdoc/Windows/Dialogs/LiveCapture.ui b/qrenderdoc/Windows/Dialogs/LiveCapture.ui
index 6a8be8685..b7cba0995 100644
--- a/qrenderdoc/Windows/Dialogs/LiveCapture.ui
+++ b/qrenderdoc/Windows/Dialogs/LiveCapture.ui
@@ -88,7 +88,7 @@
-
-
+
Capture in Progress:
@@ -159,7 +159,7 @@
-
-
+
0
diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h
index cef489f2d..c8715bf2f 100644
--- a/renderdoc/api/replay/renderdoc_replay.h
+++ b/renderdoc/api/replay/renderdoc_replay.h
@@ -1297,10 +1297,13 @@ The details of the types of messages that can be received are listed under
This function will block but only to a limited degree. If no message is waiting after a small time
it will return with a No-op message to allow further processing.
+:param ProgressCallback progress: A callback that will be repeatedly called with an updated progress
+ value when a long blocking message is coming through, e.g. a capture copy. Can be ``None`` if no
+ progress is desired.
:return: The message that was received.
:rtype: TargetControlMessage
)");
- virtual TargetControlMessage ReceiveMessage() = 0;
+ virtual TargetControlMessage ReceiveMessage(RENDERDOC_ProgressCallback progress) = 0;
protected:
ITargetControl() = default;
diff --git a/renderdoc/core/target_control.cpp b/renderdoc/core/target_control.cpp
index 1130e2f34..2be440fd3 100644
--- a/renderdoc/core/target_control.cpp
+++ b/renderdoc/core/target_control.cpp
@@ -76,6 +76,7 @@ std::string DoStringise(const PacketType &el)
STRINGISE_ENUM_NAMED(ePacket_DeleteCapture, "Delete Capture");
STRINGISE_ENUM_NAMED(ePacket_QueueCapture, "Queue Capture");
STRINGISE_ENUM_NAMED(ePacket_NewChild, "New Child");
+ STRINGISE_ENUM_NAMED(ePacket_CaptureProgress, "Capture Progress");
}
END_ENUM_STRINGISE();
}
@@ -601,7 +602,7 @@ public:
SAFE_DELETE(m_Socket);
}
- TargetControlMessage ReceiveMessage()
+ TargetControlMessage ReceiveMessage(RENDERDOC_ProgressCallback progress)
{
TargetControlMessage msg;
if(m_Socket == NULL)
@@ -762,7 +763,7 @@ public:
StreamWriter streamWriter(FileIO::fopen(msg.newCapture.path.c_str(), "wb"), Ownership::Stream);
- ser.SerialiseStream(msg.newCapture.path.c_str(), streamWriter, NULL);
+ ser.SerialiseStream(msg.newCapture.path.c_str(), streamWriter, progress);
if(reader.IsErrored())
{