Class: PipelineSystem
PipelineSystem
A system that creates and manages the GPU pipelines.
Caching Mechanism: At its core, the system employs a two-tiered caching strategy to minimize the redundant creation of GPU pipelines (or "pipes"). This strategy is based on generating unique keys that represent the state of the graphics settings and the specific requirements of the item being rendered. By caching these pipelines, subsequent draw calls with identical configurations can reuse existing pipelines instead of generating new ones.
State Management: The system differentiates between "global" state properties (like color masks and stencil masks, which do not change frequently) and properties that may vary between draw calls (such as geometry, shaders, and blend modes). Unique keys are generated for both these categories using getStateKey for global state and getGraphicsStateKey for draw-specific settings. These keys are then then used to caching the pipe. The next time we need a pipe we can check the cache by first looking at the state cache and then the pipe cache.