}
}
-void DiscardQueue::Add( BufferIndex updateBufferIndex, RefObject& resource )
-{
- // Check whether resource has GL data
- GlResourceOwner* glResource = dynamic_cast<GlResourceOwner*>( &resource );
- if ( glResource )
- {
- // Send message to clean-up GL resources in the next Render
- DoGlCleanup( updateBufferIndex, *glResource, mRenderQueue );
- }
-
- // The GL resources will now be freed in frame N
- // The Update for frame N+1 may occur in parallel with the rendering of frame N
- // Queue the node for destruction in frame N+2
- if ( 0u == updateBufferIndex )
- {
- mResourceQueue0.push_back( DiscardQueue::ResourcePointer(&resource) );
- }
- else
- {
- mResourceQueue1.push_back( DiscardQueue::ResourcePointer(&resource) );
- }
-}
-
void DiscardQueue::Add( BufferIndex updateBufferIndex, Mesh* mesh )
{
DALI_ASSERT_DEBUG( mesh );
void Add( BufferIndex updateBufferIndex, NodeAttachment* attachment );
/**
- * Adds an unwanted resource to the discard queue.
- * If necessary, a message will be sent to clean-up GL resources in the next Render.
- * @pre This method is not thread-safe, and should only be called from the update-thread.
- * @param[in] updateBufferIndex The current update buffer index.
- * @param[in] resource The resource to queue; DiscardQueue takes a reference.
- */
- void Add( BufferIndex updateBufferIndex, RefObject& resource );
-
- /**
* Adds an unwanted mesh resource to the discard queue.
* A message will be sent to clean-up GL resources in the next Render.
* @pre This method is not thread-safe, and should only be called from the update-thread.
ModelCacheIter model = mImpl->mModels.find(iter->first);
DALI_ASSERT_DEBUG( mImpl->mModels.end() != model );
- mImpl->mDiscardQueue.Add( updateBufferIndex, *(model->second) );
+ // model data is owned through intrusive pointers so no need for discard queue
mImpl->mModels.erase( model );
break;
}
{
ShaderCacheIter shaderIter = mImpl->mShaders.find(iter->first);
DALI_ASSERT_DEBUG( mImpl->mShaders.end() != shaderIter );
-
- mImpl->mDiscardQueue.Add( updateBufferIndex, *(shaderIter->second) );
+ // shader data is owned through intrusive pointers so no need for discard queue
mImpl->mShaders.erase( shaderIter );
break;
}