Skip to content

Commit bf16b0f

Browse files
committed
update progress bar after time budget exhausted
1 parent 583062a commit bf16b0f

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

SeeSharp/Common/ProgressBar.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ public void Start(int totalWork) {
104104
OnUpdate?.Invoke(this);
105105
}
106106

107+
/// <summary>
108+
/// Notifies that the process has been stopped (either finished or cancelled)
109+
/// </summary>
110+
public void Terminate()
111+
{
112+
total = done;
113+
ReportDone(0);
114+
}
115+
107116
/// <summary>
108117
/// Updates the progress bar after some work has been performed. Thread-safe.
109118
/// </summary>

SeeSharp/Integrators/Bidir/BidirBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public override void Render(Scene scene) {
101101
if (MaximumRenderTimeMs.HasValue && nextIterTime > MaximumRenderTimeMs.Value) {
102102
Logger.Log("Maximum render time exhausted.");
103103
if (EnableDenoiser) DenoiseBuffers.Denoise();
104+
progressBar.Terminate();
104105
break;
105106
}
106107

SeeSharp/Integrators/PathTracer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ public override void Render(Scene scene) {
222222
if (MaximumRenderTimeMs.HasValue && nextIterTime > MaximumRenderTimeMs.Value) {
223223
Logger.Log("Maximum render time exhausted.");
224224
if (EnableDenoiser) denoiseBuffers.Denoise();
225+
progressBar.Terminate();
225226
break;
226227
}
227228
timer.StartIteration();

0 commit comments

Comments
 (0)