@@ -85,7 +85,7 @@ class ignition::rendering::Ogre2ScenePrivate
85
85
public: uint32_t currNumCameraPasses = 0u ;
86
86
87
87
// / \brief Flag to indicate if we should flush GPU very often (per camera)
88
- public: uint8_t cameraPassCountPerGpuFlush = 6u ;
88
+ public: uint8_t cameraPassCountPerGpuFlush = 0u ;
89
89
90
90
// / \brief Name of shadow compositor node
91
91
public: const std::string kShadowNodeName = " PbsMaterialsShadowNode" ;
@@ -191,12 +191,12 @@ void Ogre2Scene::PreRender()
191
191
}
192
192
}
193
193
194
- UpdateShadowNode ();
194
+ this -> UpdateShadowNode ();
195
195
}
196
196
197
197
BaseScene::PreRender ();
198
198
199
- if (!LegacyAutoGpuFlush ())
199
+ if (!this -> LegacyAutoGpuFlush ())
200
200
{
201
201
auto engine = Ogre2RenderEngine::Instance ();
202
202
engine->OgreRoot ()->_fireFrameStarted ();
@@ -224,16 +224,18 @@ void Ogre2Scene::PostRender()
224
224
}
225
225
else
226
226
{
227
- if (dataPtr->currNumCameraPasses > 0u )
228
- FlushGpuCommandsAndStartNewFrame (0u , true );
227
+ if (this ->dataPtr ->currNumCameraPasses > 0u )
228
+ {
229
+ this ->FlushGpuCommandsAndStartNewFrame (0u , true );
230
+ }
229
231
else
230
232
{
231
233
// Every camera already calls FlushGpuCommandsAndStartNewFrame(false)
232
234
// right after rendering. So likely commands are already flushed.
233
235
//
234
236
// If we're here then we are only missing to perform the last step of
235
237
// FlushGpuCommandsAndStartNewFrame in order to start a new frame
236
- EndFrame ();
238
+ this -> EndFrame ();
237
239
}
238
240
}
239
241
}
@@ -250,8 +252,8 @@ void Ogre2Scene::StartForcedRender()
250
252
// ////////////////////////////////////////////////
251
253
void Ogre2Scene::EndForcedRender ()
252
254
{
253
- dataPtr->currNumCameraPasses = 0 ;
254
- FlushGpuCommandsOnly ();
255
+ this -> dataPtr ->currNumCameraPasses = 0u ;
256
+ this -> FlushGpuCommandsOnly ();
255
257
256
258
if (this ->LegacyAutoGpuFlush () || !this ->dataPtr ->frameUpdateStarted )
257
259
{
@@ -279,27 +281,27 @@ void Ogre2Scene::StartRendering()
279
281
}
280
282
else
281
283
{
282
- IGN_ASSERT ( this ->dataPtr ->frameUpdateStarted == true ,
283
- " Started rendering without first calling Scene::PreRender. "
284
- " See Scene::SetCameraPassCountPerGpuFlush for details" );
284
+ IGN_ASSERT (this ->dataPtr ->frameUpdateStarted == true ,
285
+ " Started rendering without first calling Scene::PreRender. "
286
+ " See Scene::SetCameraPassCountPerGpuFlush for details" );
285
287
}
286
288
}
287
289
288
290
// ////////////////////////////////////////////////
289
291
void Ogre2Scene::FlushGpuCommandsAndStartNewFrame (uint8_t _numPasses,
290
292
bool _startNewFrame)
291
293
{
292
- dataPtr->currNumCameraPasses += _numPasses;
294
+ this -> dataPtr ->currNumCameraPasses += _numPasses;
293
295
294
- if (dataPtr->currNumCameraPasses >= dataPtr->cameraPassCountPerGpuFlush ||
295
- _startNewFrame)
296
+ if (this -> dataPtr ->currNumCameraPasses >= dataPtr->cameraPassCountPerGpuFlush
297
+ || _startNewFrame)
296
298
{
297
- dataPtr->currNumCameraPasses = 0 ;
298
- FlushGpuCommandsOnly ();
299
+ this -> dataPtr ->currNumCameraPasses = 0u ;
300
+ this -> FlushGpuCommandsOnly ();
299
301
300
302
// Legacy mode requires to do EndFrame here every time
301
303
if (dataPtr->cameraPassCountPerGpuFlush == 0u || _startNewFrame)
302
- EndFrame ();
304
+ this -> EndFrame ();
303
305
}
304
306
}
305
307
@@ -341,8 +343,8 @@ void Ogre2Scene::EndFrame()
341
343
auto itor = ogreRoot->getSceneManagerIterator ();
342
344
while (itor.hasMoreElements ())
343
345
{
344
- Ogre::SceneManager *sceneManager = itor.getNext ();
345
- sceneManager->clearFrameData ();
346
+ Ogre::SceneManager *sceneManager = itor.getNext ();
347
+ sceneManager->clearFrameData ();
346
348
}
347
349
348
350
ogreRoot->_fireFrameEnded ();
@@ -1158,7 +1160,7 @@ void Ogre2Scene::CreateContext()
1158
1160
1159
1161
// See ogre doxygen documentation regarding culling methods.
1160
1162
// In some cases you may still want to use single thread.
1161
- // if( numThreads > 1 )
1163
+ // if ( numThreads > 1)
1162
1164
// threadedCullingMethod = Ogre::INSTANCING_CULLING_THREADED;
1163
1165
// Create the SceneManager, in this case a generic one
1164
1166
this ->ogreSceneManager = root->createSceneManager (Ogre::ST_GENERIC,
0 commit comments