Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Sensors aware of CameraPassCountPerGpuFlush & Scene::PostFrame #145

Merged
merged 4 commits into from
Jul 20, 2021
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
8 changes: 8 additions & 0 deletions src/RenderingSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,13 @@ void RenderingSensor::Render()
rc->PostRender();
}
}

if (!this->dataPtr->manualSceneUpdate &&
!this->dataPtr->scene->LegacyAutoGpuFlush())
{
// When LegacyAutoGpuFlush = true, that function gets
// called per sensor, so we don't have to do anything here
this->dataPtr->scene->PostRender();
}
}

4 changes: 4 additions & 0 deletions test/integration/gpu_lidar_sensor_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ void GpuLidarSensorTest::ManualUpdate(const std::string &_renderEngine)
ignition::rendering::VisualPtr root = scene->RootVisual();

scene->SetAmbientLight(0.3, 0.3, 0.3);
scene->SetCameraPassCountPerGpuFlush(6u);

// Create a sensor manager
ignition::sensors::Manager mgr;
Expand Down Expand Up @@ -791,6 +792,9 @@ void GpuLidarSensorTest::ManualUpdate(const std::string &_renderEngine)
// Render and update
mgr.RunOnce(std::chrono::steady_clock::duration::zero());

// manually finish update scene
scene->PostRender();

int mid = horzSamples / 2;
int last = (horzSamples - 1);
double unitBoxSize = 1.0;
Expand Down