MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / _waitFor

Method _waitFor

OgreMain/src/OgreTextureGpuManager.cpp:3622–3649  ·  view source on GitHub ↗

-----------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3620 }
3621 //-----------------------------------------------------------------------------------
3622 void TextureGpuManager::_waitFor( TextureGpu *texture, bool metadataOnly )
3623 {
3624 bool bDone = false;
3625 while( !bDone )
3626 {
3627 bool workerThreadDone = _update( true );
3628 bDone = workerThreadDone && mDownloadToRamQueue.empty() && mScheduledTasks.empty();
3629 if( !bDone )
3630 {
3631 if( texture->getPendingResidencyChanges() == 0u )
3632 {
3633 if( texture->isDataReady() )
3634 bDone = true;
3635 else if( metadataOnly && texture->isMetadataReady() )
3636 bDone = true;
3637 }
3638
3639 if( !bDone )
3640 {
3641 mVaoManager->_update();
3642 if( !workerThreadDone )
3643 mRequestToMainThreadEvent.wait();
3644 else
3645 Threads::Sleep( 1 );
3646 }
3647 }
3648 }
3649 }
3650 //-----------------------------------------------------------------------------------
3651 void TextureGpuManager::_waitForPendingGpuToCpuSyncs( TextureGpu *texture )
3652 {

Callers 2

waitForMetadataMethod · 0.80
waitForDataMethod · 0.80

Calls 6

isDataReadyMethod · 0.80
isMetadataReadyMethod · 0.80
emptyMethod · 0.45
_updateMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected