D3D12: inline stencil test as GL and Vulkan backend (#1945)

This commit is contained in:
raven02 2016-07-19 16:52:14 +08:00 committed by GitHub
parent 04926374f7
commit 6296453ef3
1 changed files with 23 additions and 19 deletions

View File

@ -163,7 +163,10 @@ void D3D12GSRender::load_program()
prop.DepthStencil.DepthEnable = FALSE; prop.DepthStencil.DepthEnable = FALSE;
prop.DepthStencil.DepthWriteMask = rsx::method_registers.depth_write_enabled() ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO; prop.DepthStencil.DepthWriteMask = rsx::method_registers.depth_write_enabled() ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO;
prop.DepthStencil.StencilEnable = rsx::method_registers.stencil_test_enabled();
if (rsx::method_registers.stencil_test_enabled())
{
prop.DepthStencil.StencilEnable = TRUE;
prop.DepthStencil.StencilReadMask = rsx::method_registers.stencil_func_mask(); prop.DepthStencil.StencilReadMask = rsx::method_registers.stencil_func_mask();
prop.DepthStencil.StencilWriteMask = rsx::method_registers.stencil_mask(); prop.DepthStencil.StencilWriteMask = rsx::method_registers.stencil_mask();
prop.DepthStencil.FrontFace.StencilPassOp = get_stencil_op(rsx::method_registers.stencil_op_zpass()); prop.DepthStencil.FrontFace.StencilPassOp = get_stencil_op(rsx::method_registers.stencil_op_zpass());
@ -185,6 +188,7 @@ void D3D12GSRender::load_program()
prop.DepthStencil.BackFace.StencilFailOp = get_stencil_op(rsx::method_registers.stencil_op_fail()); prop.DepthStencil.BackFace.StencilFailOp = get_stencil_op(rsx::method_registers.stencil_op_fail());
prop.DepthStencil.BackFace.StencilFunc = get_compare_func(rsx::method_registers.stencil_func()); prop.DepthStencil.BackFace.StencilFunc = get_compare_func(rsx::method_registers.stencil_func());
} }
}
// Sensible default value // Sensible default value
static D3D12_RASTERIZER_DESC CD3D12_RASTERIZER_DESC = static D3D12_RASTERIZER_DESC CD3D12_RASTERIZER_DESC =