Class MutablePipelineState
A convenience class that allows to compose a Pipeline State by modifying its configuration (as PipelineState objects are immutable once compiled), and only compile it into a Pipeline State object when needed.
public class MutablePipelineState
- Inheritance
-
objectMutablePipelineState
- Extension Methods
Remarks
To minimize the creation of PipelineState objects, they are cached internally per Graphics Device based on their description, so subsequent uses of a Pipeline State with the same description uses the same instance instead of allocating a new one.
Constructors
MutablePipelineState(GraphicsDevice)
Initializes a new instance of the MutablePipelineState class.
public MutablePipelineState(GraphicsDevice graphicsDevice)
Parameters
graphicsDeviceGraphicsDeviceThe Graphics Device.
Properties
CurrentState
Gets the current compiled Pipeline State.
public PipelineState? CurrentState { get; }
Property Value
- PipelineState
The current compiled Pipeline State. If this instance have not compiled any Pipeline State, the value will be null.
State
Gets the description of the current Pipeline State.
public PipelineStateDescription State { get; }
Property Value
Methods
Update()
Determines if the mutable Pipeline State has changed, and updates the CurrentState.
public void Update()
Remarks
This method uses the current mutable Pipeline State to look for a cached PipelineState with the same description. If found, it is returned. If not, a new Pipeline State object is compiled from the current description (State), and cached for subsequent uses.