Skip to content

Commit

Permalink
Avoid busy-waiting if renderFrame is skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
johguenther committed Sep 12, 2018
1 parent 211f7f9 commit e9b8b2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/common/sg/SceneGraph.cpp
Expand Up @@ -124,7 +124,7 @@ namespace ospray {

if (accumBudgetReached || varianceReached) {
etaSeconds = elapsedSeconds();
return fbNode;//XXX false;
return nullptr;
}

if (numAccumulatedFrames == 0)
Expand Down
5 changes: 5 additions & 0 deletions apps/exampleViewer/common/util/AsyncRenderEngine.cpp
Expand Up @@ -50,6 +50,11 @@ namespace ospray {
if (frameCancelled.exchange(false))
return; // actually a continue

if (!sgFB) {
std::this_thread::sleep_for(std::chrono::milliseconds(15));
return; // actually a continue
}

// NOTE(jda) - Spin here until the consumer has had the chance to update
// to the latest frame.
while(state == ExecState::RUNNING && newPixels == true);
Expand Down

0 comments on commit e9b8b2c

Please sign in to comment.