Class RenderStateTracker
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Tracks and applies render state for one device context. Owns the pass baseline () and a shadow of the last applied state, so only sets what changed. State is per context, so each owns one.
public class RenderStateTrackerInheritance
Properties
CurrentDynamic
Gets the dynamic state currently set.
public DynamicState CurrentDynamic { get; }Property Value
CurrentPass
Gets the state of the innermost enclosing pass. Compose per-draw state by copying this and overriding fields.
public RenderState CurrentPass { get; }Property Value
Methods
Apply(in RenderState)
Applies a state. Diffs at two levels: one packed compare per descriptor, then only the calls whose fields changed inside a changed descriptor.
public void Apply(in RenderState state)Parameters
state RenderState
ApplyDynamic(in DynamicState)
Sets dynamic state, emitting only the calls whose values changed.
public void ApplyDynamic(in DynamicState state)Parameters
state DynamicState
RestorePassBaseline()
Re-applies , for draws that cannot set state themselves and would otherwise inherit whatever the last draw latched.
public void RestorePassBaseline()Scope(RsFillMode?, RsCullMode?, bool?, int?, float?, float?, bool?, bool?, RsComparison?, bool?, RsBlendMode?, RsBlendMode?, RsColorWriteEnableBits?)
Composes a state over and applies it for the scope of the returned using guard. Omitted arguments keep the pass value. For state not covered here (e.g. stencil), build a and open a directly.
public RenderPassScope Scope(RsFillMode? fillMode = null, RsCullMode? cullMode = null, bool? multisampleEnable = null, int? depthBias = null, float? depthBiasClamp = null, float? slopeScaledDepthBias = null, bool? depthTest = null, bool? depthWrite = null, RsComparison? depthFunc = null, bool? blend = null, RsBlendMode? srcBlend = null, RsBlendMode? dstBlend = null, RsColorWriteEnableBits? colorWriteMask = null)Parameters
fillMode RsFillMode?
cullMode RsCullMode?
multisampleEnable bool?
depthBias int?
depthBiasClamp float?
slopeScaledDepthBias float?
depthTest bool?
depthWrite bool?
depthFunc RsComparison?
blend bool?
srcBlend RsBlendMode?
dstBlend RsBlendMode?
colorWriteMask RsColorWriteEnableBits?
Returns
The guard that restores the previous baseline on dispose.
Scope(in RenderState)
Applies a state as the pass baseline for the scope of the returned using guard.
public RenderPassScope Scope(in RenderState state)Parameters
state RenderState
Returns
ScopeDynamic(DepthRange?, float?, bool?)
Sets dynamic state for the scope of the returned using guard, restoring what was set before on dispose. Omitted arguments keep the current value.
public DynamicStateScope ScopeDynamic(Renderer.DepthRange? depthRange = null, float? clearDepth = null, bool? scissorTest = null)Parameters
depthRange Renderer.DepthRange?
clearDepth float?
scissorTest bool?
Returns
SetDepthRange(DepthRange)
Sets the depth range, for passes that hand the same range to several draws.
public void SetDepthRange(Renderer.DepthRange range)Parameters
range Renderer.DepthRange
SetPassBaseline(in RenderState)
Applies a state and makes it .
public void SetPassBaseline(in RenderState state)Parameters
state RenderState

