diff --git a/src/RenderingSensor.cc b/src/RenderingSensor.cc index ef99bcfe..aeba5918 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->LegacyAutoGpuFlush()) + { + // 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 ca4c022c..d906e62e 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->SetCameraPassCountPerGpuFlush(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;