Skip to content

Commit

Permalink
Make Sensors aware of CameraPassCountPerGpuFlush & Scene::PostFrame (#…
Browse files Browse the repository at this point in the history
…145)

* Call Scene::PostRenderGpuFlush

Requires ign-rendering update to compile correctly
Requires ign-gazebo update to run correctly

Affects gazebosim/gz-rendering#323

Signed-off-by: Matias N. Goldberg <dark_sylinc@yahoo.com.ar>

* Update to use the renamed PostRender call

Signed-off-by: Matias N. Goldberg <dark_sylinc@yahoo.com.ar>

* Update integration test

Signed-off-by: Matias N. Goldberg <dark_sylinc@yahoo.com.ar>

* Rename SetNumCameraPassesPerGpuFlush -> SetCameraPassCountPerGpuFlush

Signed-off-by: Matias N. Goldberg <dark_sylinc@yahoo.com.ar>
  • Loading branch information
darksylinc committed Jul 20, 2021
1 parent 53c87ea commit d21c6f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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

0 comments on commit d21c6f3

Please sign in to comment.