mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-09-07 17:39:09 +01:00
Merge pull request #7001 from ameerj/wario-fix
vk_rasterizer: Fix dynamic StencilOp updating when two faces are enabled
This commit is contained in:
commit
1bb28dfe2c
1 changed files with 8 additions and 6 deletions
|
@ -765,12 +765,7 @@ void RasterizerVulkan::UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs) {
|
||||||
const Maxwell::StencilOp zpass = regs.stencil_front_op_zpass;
|
const Maxwell::StencilOp zpass = regs.stencil_front_op_zpass;
|
||||||
const Maxwell::ComparisonOp compare = regs.stencil_front_func_func;
|
const Maxwell::ComparisonOp compare = regs.stencil_front_func_func;
|
||||||
if (regs.stencil_two_side_enable) {
|
if (regs.stencil_two_side_enable) {
|
||||||
scheduler.Record([fail, zfail, zpass, compare](vk::CommandBuffer cmdbuf) {
|
// Separate stencil op per face
|
||||||
cmdbuf.SetStencilOpEXT(VK_STENCIL_FACE_FRONT_AND_BACK, MaxwellToVK::StencilOp(fail),
|
|
||||||
MaxwellToVK::StencilOp(zpass), MaxwellToVK::StencilOp(zfail),
|
|
||||||
MaxwellToVK::ComparisonOp(compare));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
const Maxwell::StencilOp back_fail = regs.stencil_back_op_fail;
|
const Maxwell::StencilOp back_fail = regs.stencil_back_op_fail;
|
||||||
const Maxwell::StencilOp back_zfail = regs.stencil_back_op_zfail;
|
const Maxwell::StencilOp back_zfail = regs.stencil_back_op_zfail;
|
||||||
const Maxwell::StencilOp back_zpass = regs.stencil_back_op_zpass;
|
const Maxwell::StencilOp back_zpass = regs.stencil_back_op_zpass;
|
||||||
|
@ -785,6 +780,13 @@ void RasterizerVulkan::UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs) {
|
||||||
MaxwellToVK::StencilOp(back_zfail),
|
MaxwellToVK::StencilOp(back_zfail),
|
||||||
MaxwellToVK::ComparisonOp(back_compare));
|
MaxwellToVK::ComparisonOp(back_compare));
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// Front face defines the stencil op of both faces
|
||||||
|
scheduler.Record([fail, zfail, zpass, compare](vk::CommandBuffer cmdbuf) {
|
||||||
|
cmdbuf.SetStencilOpEXT(VK_STENCIL_FACE_FRONT_AND_BACK, MaxwellToVK::StencilOp(fail),
|
||||||
|
MaxwellToVK::StencilOp(zpass), MaxwellToVK::StencilOp(zfail),
|
||||||
|
MaxwellToVK::ComparisonOp(compare));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue