Rebel Fork Framework
Urho3D::BatchStateCache Class Reference

Pipeline state cache for RenderPipeline batches. More...

#include <Urho3D/RenderPipeline/BatchStateCache.h>

Inheritance diagram for Urho3D::BatchStateCache:
Urho3D::NonCopyable

Public Member Functions

void Invalidate ()
 Invalidate cache.
 
void SetOutputDesc (const PipelineStateOutputDesc &outputDesc)
 Set currently used output description. Invalidates cache if it has changed.
 
PipelineState * GetPipelineState (const BatchStateLookupKey &key) const
 
PipelineState * GetOrCreatePipelineState (const BatchStateCreateKey &key, const BatchStateCreateContext &ctx, BatchStateCacheCallback *callback)
 
PipelineState * GetOrCreatePlaceholderPipelineState (unsigned vertexStride, BatchStateCacheCallback *callback)
 

Private Attributes

ea::optional< PipelineStateOutputDesc > outputDesc_
 Current output description. Invalid on start.
 
ea::unordered_map< BatchStateLookupKey, CachedBatchStatecache_
 Cached states, possibly invalid.
 
ea::unordered_map< unsigned, SharedPtr< PipelineState > > placeholderCache_
 Cached placeholder states.
 

Additional Inherited Members

- Protected Member Functions inherited from Urho3D::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
 
 NonCopyable (NonCopyable &&other)=delete
 
NonCopyableoperator= (const NonCopyable &other)=delete
 
NonCopyableoperator= (NonCopyable &&other)=delete
 

Detailed Description

Pipeline state cache for RenderPipeline batches.

Member Function Documentation

◆ GetOrCreatePipelineState()

PipelineState * Urho3D::BatchStateCache::GetOrCreatePipelineState ( const BatchStateCreateKey key,
const BatchStateCreateContext ctx,
BatchStateCacheCallback callback 
)

Return existing or create new pipeline state. Not thread safe. Resulting state may be invalid.

◆ GetOrCreatePlaceholderPipelineState()

PipelineState * Urho3D::BatchStateCache::GetOrCreatePlaceholderPipelineState ( unsigned  vertexStride,
BatchStateCacheCallback callback 
)

Return existing or create new placeholder pipeline state. Not thread safe. Resulting state may be invalid in case of emergencies.

◆ GetPipelineState()

PipelineState * Urho3D::BatchStateCache::GetPipelineState ( const BatchStateLookupKey key) const

Return existing pipeline state or nullptr if not found. Thread-safe. Resulting state may be invalid.


The documentation for this class was generated from the following files: