Class PipelineVariantCache<K>
java.lang.Object
dev.engine.graphics.pipeline.PipelineVariantCache<K>
- Type Parameters:
K- the variant key type (must implement equals/hashCode)
Frame-based pipeline variant cache with automatic eviction.
Backends that bake render state into pipeline objects (Vulkan, WebGPU) use this to cache pipeline variants keyed by render state. Variants unused for a configurable number of frames are evicted automatically.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDestroys all cached variants.voidEvicts variants not used forevictionFrames.longgetOrCreate(K key, long currentFrame, Function<K, Long> factory) Gets or creates a variant for the given key.voidRemoves all variants matching a predicate (e.g., when a base pipeline is destroyed).intsize()
-
Constructor Details
-
PipelineVariantCache
public PipelineVariantCache(long evictionFrames, int checkInterval) -
PipelineVariantCache
public PipelineVariantCache()
-
-
Method Details
-
getOrCreate
-
evict
-
removeIf
-
clear
-
size
public int size()
-