Class RenderStateBlock
- Namespace
- ShadowDusk.Core
- Assembly
- ShadowDusk.Core.dll
The render states declared inside a single FX pass, parsed from the source by
RenderStateParser. Every state is nullable so a state left unset in the
source stays absent (rather than defaulting), which lets the MgfxWriter
decide via the Has* gates whether to emit each of the three optional MGFX
state-object headers. The FNA-only states (and KnownFnaThrowingStates)
are consumed solely by the FNA fx_2_0 path and are deliberately kept out of the
Has* gates so they never alter MGFX v10 output.
public sealed record RenderStateBlock : IEquatable<RenderStateBlock>
- Inheritance
-
RenderStateBlock
- Implements
- Inherited Members
Properties
AlphaBlendEnable
Whether alpha blending is enabled for this pass.
public bool? AlphaBlendEnable { get; init; }
Property Value
- bool?
AlphaBlendFunction
Blend function combining the alpha source and destination terms.
public BlendFunctionValue? AlphaBlendFunction { get; init; }
Property Value
AlphaDestinationBlend
Destination blend factor for the alpha channel.
public BlendValue? AlphaDestinationBlend { get; init; }
Property Value
AlphaSourceBlend
Source blend factor for the alpha channel.
public BlendValue? AlphaSourceBlend { get; init; }
Property Value
BlendFactor
FNA fx_2_0 only (op 96): constant blend factor, as a D3DCOLOR dword.
public uint? BlendFactor { get; init; }
Property Value
- uint?
ColorBlendFunction
Blend function combining the color source and destination terms.
public BlendFunctionValue? ColorBlendFunction { get; init; }
Property Value
ColorDestinationBlend
Destination blend factor for the color channels.
public BlendValue? ColorDestinationBlend { get; init; }
Property Value
ColorSourceBlend
Source blend factor for the color channels.
public BlendValue? ColorSourceBlend { get; init; }
Property Value
ColorWriteChannels
Color-channel write mask (a D3DCOLORWRITEENABLE bitmask: Red|Green|Blue|Alpha).
public int? ColorWriteChannels { get; init; }
Property Value
- int?
ColorWriteChannels1
FNA fx_2_0 only (op 93): color-write mask for render target 1.
public int? ColorWriteChannels1 { get; init; }
Property Value
- int?
ColorWriteChannels2
FNA fx_2_0 only (op 94): color-write mask for render target 2.
public int? ColorWriteChannels2 { get; init; }
Property Value
- int?
ColorWriteChannels3
FNA fx_2_0 only (op 95): color-write mask for render target 3.
public int? ColorWriteChannels3 { get; init; }
Property Value
- int?
CounterClockwiseStencilDepthBufferFail
FNA fx_2_0 only (op 90): back-face stencil operation when stencil passes but depth fails.
public StencilOperationValue? CounterClockwiseStencilDepthBufferFail { get; init; }
Property Value
CounterClockwiseStencilFail
FNA fx_2_0 only (op 89): back-face stencil operation when the stencil test fails.
public StencilOperationValue? CounterClockwiseStencilFail { get; init; }
Property Value
CounterClockwiseStencilFunction
FNA fx_2_0 only (op 92): back-face stencil comparison function.
public CompareFunctionValue? CounterClockwiseStencilFunction { get; init; }
Property Value
CounterClockwiseStencilPass
FNA fx_2_0 only (op 91): back-face stencil operation when both tests pass.
public StencilOperationValue? CounterClockwiseStencilPass { get; init; }
Property Value
CullMode
Which triangle faces are culled.
public CullModeValue? CullMode { get; init; }
Property Value
DepthBias
Constant depth bias added to a fragment's depth.
public float? DepthBias { get; init; }
Property Value
DepthBufferEnable
Whether the depth (z) buffer test is enabled.
public bool? DepthBufferEnable { get; init; }
Property Value
- bool?
DepthBufferFunction
Comparison function for the depth test.
public CompareFunctionValue? DepthBufferFunction { get; init; }
Property Value
DepthBufferWriteEnable
Whether depth writes to the z-buffer are enabled.
public bool? DepthBufferWriteEnable { get; init; }
Property Value
- bool?
FillMode
Whether triangles are filled solid or drawn as wireframe.
public FillModeValue? FillMode { get; init; }
Property Value
HasBlendState
Whether any MGFX-honored blend state is set, gating whether the MgfxWriter emits the optional blend-state header. (The FNA-only blend states are deliberately excluded so they never change MGFX v10 output.)
public bool HasBlendState { get; }
Property Value
HasDepthStencilState
Whether any MGFX-honored depth/stencil state is set, gating whether the MgfxWriter emits the optional depth-stencil-state header. (The FNA-only two-sided stencil states are deliberately excluded.)
public bool HasDepthStencilState { get; }
Property Value
HasRasterizerState
Whether any MGFX-honored rasterizer state is set, gating whether the MgfxWriter emits the optional rasterizer-state header. (The FNA-only multisample mask is deliberately excluded.)
public bool HasRasterizerState { get; }
Property Value
KnownFnaThrowingStates
FX render-state keys present in the pass that FNA's Effect runtime throws
NotImplementedException on at EffectPass.Apply (the non-honored ops
of docs/fx2-binary-format.md ยง8.2, e.g. AlphaTestEnable, fog and point-sprite
states). Recorded by RenderStateParser so the FNA path can fail
loudly instead of silently diverging from the fxc build (which crashes FNA at
runtime). Sorted ordinally for deterministic diagnostics. MGFX paths ignore this
metadata entirely.
public IReadOnlyList<string> KnownFnaThrowingStates { get; init; }
Property Value
MultiSampleAntiAlias
Whether multisample antialiasing is enabled.
public bool? MultiSampleAntiAlias { get; init; }
Property Value
- bool?
MultiSampleMask
FNA fx_2_0 only (op 68): multisample coverage mask, as a dword.
public uint? MultiSampleMask { get; init; }
Property Value
- uint?
ReferenceStencil
Reference value the stencil test compares against.
public int? ReferenceStencil { get; init; }
Property Value
- int?
ScissorTestEnable
Whether the scissor-rectangle test is enabled.
public bool? ScissorTestEnable { get; init; }
Property Value
- bool?
SeparateAlphaBlendEnable
FNA fx_2_0 only (op 99): enable separate color/alpha blend functions.
public bool? SeparateAlphaBlendEnable { get; init; }
Property Value
- bool?
SlopeScaleDepthBias
Slope-scaled depth bias factor.
public float? SlopeScaleDepthBias { get; init; }
Property Value
StencilDepthBufferFail
Stencil operation when the stencil test passes but the depth test fails.
public StencilOperationValue? StencilDepthBufferFail { get; init; }
Property Value
StencilEnable
Whether stencil testing is enabled.
public bool? StencilEnable { get; init; }
Property Value
- bool?
StencilFail
Stencil operation when the stencil test fails.
public StencilOperationValue? StencilFail { get; init; }
Property Value
StencilFunction
Comparison function for the stencil test.
public CompareFunctionValue? StencilFunction { get; init; }
Property Value
StencilMask
Mask applied to both the reference and stored stencil values before comparison.
public int? StencilMask { get; init; }
Property Value
- int?
StencilPass
Stencil operation when both the stencil and depth tests pass.
public StencilOperationValue? StencilPass { get; init; }
Property Value
StencilWriteMask
Mask controlling which stencil bits may be written.
public int? StencilWriteMask { get; init; }
Property Value
- int?
TwoSidedStencilMode
FNA fx_2_0 only (op 88): enable two-sided (front/back) stencil operations.
public bool? TwoSidedStencilMode { get; init; }
Property Value
- bool?