Skip to content

Commit ae750eb

Browse files
committed
only output TSD device state file when needed
1 parent 2e4af22 commit ae750eb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tsd/src/anari_tsd/Frame.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,12 @@ void Frame::renderFrame()
113113
auto *state = deviceState();
114114
state->commitBuffer.flush();
115115

116-
const char *filename = "live_capture.tsd";
117-
reportMessage(ANARI_SEVERITY_INFO, "exporting scene to '%s'", filename);
118-
tsd::io::save_Scene(state->scene, filename);
116+
if (m_lastCommitFlushOccured < state->commitBuffer.lastObjectFinalization()) {
117+
m_lastCommitFlushOccured = state->commitBuffer.lastObjectFinalization();
118+
const char *filename = "live_capture.tsd";
119+
reportMessage(ANARI_SEVERITY_INFO, "exporting scene to '%s'", filename);
120+
tsd::io::save_Scene(state->scene, filename);
121+
}
119122

120123
anari::render(state->device, m_anariFrame);
121124
}

tsd/src/anari_tsd/Frame.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ struct Frame : public helium::BaseFrame
4848
helium::IntrusivePtr<TSDObject> m_camera;
4949

5050
anari::Frame m_anariFrame{nullptr};
51+
52+
helium::TimeStamp m_lastCommitFlushOccured{0};
5153
};
5254

5355
} // namespace tsd_device

0 commit comments

Comments
 (0)