fix stencil API

what_if_no_video_threads
cosmonaut 2024-03-02 23:10:44 -08:00
parent 00adec189c
commit 019afa91f5
4 changed files with 29 additions and 12 deletions

@ -1 +1 @@
Subproject commit 4268db46161ec5ff924c8006a66aa59635d3ca50
Subproject commit 86cc5fa1422c8b79c436c4e4fc345114e9615dbb

View File

@ -154,11 +154,7 @@ namespace MoonWorks.Graphics
public StencilOp PassOp;
public StencilOp DepthFailOp;
public CompareOp CompareOp;
public uint CompareMask;
public uint WriteMask;
public uint Reference;
// FIXME: can we do an explicit cast here?
public Refresh.StencilOpState ToRefresh()
{
return new Refresh.StencilOpState
@ -166,10 +162,7 @@ namespace MoonWorks.Graphics
failOp = (Refresh.StencilOp) FailOp,
passOp = (Refresh.StencilOp) PassOp,
depthFailOp = (Refresh.StencilOp) DepthFailOp,
compareOp = (Refresh.CompareOp) CompareOp,
compareMask = CompareMask,
writeMask = WriteMask,
reference = Reference
compareOp = (Refresh.CompareOp) CompareOp
};
}
}

View File

@ -61,7 +61,11 @@ namespace MoonWorks.Graphics
refreshGraphicsPipelineCreateInfo.blendConstants[2] = blendConstants.B;
refreshGraphicsPipelineCreateInfo.blendConstants[3] = blendConstants.A;
refreshGraphicsPipelineCreateInfo.depthStencilState.stencilState = depthStencilState.StencilState.ToRefresh();
refreshGraphicsPipelineCreateInfo.depthStencilState.backStencilState = depthStencilState.BackStencilState.ToRefresh();
refreshGraphicsPipelineCreateInfo.depthStencilState.frontStencilState = depthStencilState.FrontStencilState.ToRefresh();
refreshGraphicsPipelineCreateInfo.depthStencilState.compareMask = depthStencilState.CompareMask;
refreshGraphicsPipelineCreateInfo.depthStencilState.writeMask = depthStencilState.WriteMask;
refreshGraphicsPipelineCreateInfo.depthStencilState.reference = depthStencilState.Reference;
refreshGraphicsPipelineCreateInfo.depthStencilState.compareOp = (Refresh.CompareOp) depthStencilState.CompareOp;
refreshGraphicsPipelineCreateInfo.depthStencilState.depthBoundsTestEnable = Conversions.BoolToByte(depthStencilState.DepthBoundsTestEnable);
refreshGraphicsPipelineCreateInfo.depthStencilState.depthTestEnable = Conversions.BoolToByte(depthStencilState.DepthTestEnable);

View File

@ -11,9 +11,29 @@
public bool DepthTestEnable;
/// <summary>
/// Describes the stencil operation.
/// Describes the back-face stencil operation.
/// </summary>
public StencilOpState StencilState;
public StencilOpState BackStencilState;
/// <summary>
/// Describes the front-face stencil operation.
/// </summary>
public StencilOpState FrontStencilState;
/// <summary>
/// The compare mask for stencil ops.
/// </summary>
public uint CompareMask;
/// <summary>
/// The write mask for stencil ops.
/// </summary>
public uint WriteMask;
/// <summary>
/// The stencil reference value.
/// </summary>
public uint Reference;
/// <summary>
/// The comparison operator used in the depth test.