From e7c5046a3c70700d55e7349f03ad058ea440d559 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Sun, 16 May 2021 21:01:18 -0300 Subject: [PATCH 1/4] Call Scene::PostRenderGpuFlush Requires ign-rendering update to compile correctly Requires ign-gazebo update to run correctly Affects ignitionrobotics/ign-rendering#323 Signed-off-by: Matias N. Goldberg --- src/RenderingSensor.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/RenderingSensor.cc b/src/RenderingSensor.cc index ef99bcfe..7ffa7c30 100644 --- a/src/RenderingSensor.cc +++ b/src/RenderingSensor.cc @@ -111,5 +111,13 @@ void RenderingSensor::Render() rc->PostRender(); } } + + if (!this->dataPtr->manualSceneUpdate && + !this->dataPtr->scene->GetLegacyAutoGpuFlush()) + { + // When GetLegacyAutoGpuFlush = true, that function gets + // called per sensor, so we don't have to do anything here + this->dataPtr->scene->PostRenderGpuFlush(); + } } From d764e537bc28c6951d263516bd3e355b4c8db157 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Sun, 23 May 2021 21:55:18 -0300 Subject: [PATCH 2/4] Update to use the renamed PostRender call Signed-off-by: Matias N. Goldberg --- src/RenderingSensor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RenderingSensor.cc b/src/RenderingSensor.cc index 7ffa7c30..3cc876e7 100644 --- a/src/RenderingSensor.cc +++ b/src/RenderingSensor.cc @@ -117,7 +117,7 @@ void RenderingSensor::Render() { // When GetLegacyAutoGpuFlush = true, that function gets // called per sensor, so we don't have to do anything here - this->dataPtr->scene->PostRenderGpuFlush(); + this->dataPtr->scene->PostRender(); } } From c29a21131f24576ef9a8320e66ce53ab500327b4 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Sun, 30 May 2021 21:32:22 -0300 Subject: [PATCH 3/4] Update integration test Signed-off-by: Matias N. Goldberg --- test/integration/gpu_lidar_sensor_plugin.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/integration/gpu_lidar_sensor_plugin.cc b/test/integration/gpu_lidar_sensor_plugin.cc index ca4c022c..e913f297 100644 --- a/test/integration/gpu_lidar_sensor_plugin.cc +++ b/test/integration/gpu_lidar_sensor_plugin.cc @@ -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->SetNumCameraPassesPerGpuFlush(6u); // Create a sensor manager ignition::sensors::Manager mgr; @@ -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; From 97766e68422084e3b5653e3e4470ed19550f2e84 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Sun, 6 Jun 2021 17:45:39 -0300 Subject: [PATCH 4/4] Rename SetNumCameraPassesPerGpuFlush -> SetCameraPassCountPerGpuFlush Signed-off-by: Matias N. Goldberg --- src/RenderingSensor.cc | 4 ++-- test/integration/gpu_lidar_sensor_plugin.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RenderingSensor.cc b/src/RenderingSensor.cc index 3cc876e7..aeba5918 100644 --- a/src/RenderingSensor.cc +++ b/src/RenderingSensor.cc @@ -113,9 +113,9 @@ void RenderingSensor::Render() } if (!this->dataPtr->manualSceneUpdate && - !this->dataPtr->scene->GetLegacyAutoGpuFlush()) + !this->dataPtr->scene->LegacyAutoGpuFlush()) { - // When GetLegacyAutoGpuFlush = true, that function gets + // When LegacyAutoGpuFlush = true, that function gets // called per sensor, so we don't have to do anything here this->dataPtr->scene->PostRender(); } diff --git a/test/integration/gpu_lidar_sensor_plugin.cc b/test/integration/gpu_lidar_sensor_plugin.cc index e913f297..d906e62e 100644 --- a/test/integration/gpu_lidar_sensor_plugin.cc +++ b/test/integration/gpu_lidar_sensor_plugin.cc @@ -751,7 +751,7 @@ void GpuLidarSensorTest::ManualUpdate(const std::string &_renderEngine) ignition::rendering::VisualPtr root = scene->RootVisual(); scene->SetAmbientLight(0.3, 0.3, 0.3); - scene->SetNumCameraPassesPerGpuFlush(6u); + scene->SetCameraPassCountPerGpuFlush(6u); // Create a sensor manager ignition::sensors::Manager mgr;