- add managed RenderStateBlock authoring types and wire them through DrawingSettings - let RenderObjectsRendererFeature author depth and stencil overrides for scene draws - apply scene draw render state overrides inside builtin forward pipeline and document the stage plan
28 lines
740 B
C#
28 lines
740 B
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace XCEngine.Rendering
|
|
{
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct RenderStateBlock
|
|
{
|
|
public RenderStateMask mask;
|
|
public DepthState depthState;
|
|
public StencilState stencilState;
|
|
public byte stencilReference;
|
|
|
|
public bool hasOverrides =>
|
|
mask != RenderStateMask.None;
|
|
|
|
public static RenderStateBlock CreateDefault()
|
|
{
|
|
return new RenderStateBlock
|
|
{
|
|
mask = RenderStateMask.None,
|
|
depthState = DepthState.CreateDefault(),
|
|
stencilState = StencilState.CreateDefault(),
|
|
stencilReference = 0
|
|
};
|
|
}
|
|
}
|
|
}
|