diff options
author | Fernando S <fsahmkow27@gmail.com> | 2021-09-13 23:16:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 23:16:59 +0200 |
commit | 1bb28dfe2c21dcce7a2c3b189c768c4b74316509 (patch) | |
tree | 61abfaa5146f35496b34f3912568ffddef342f78 /src | |
parent | Merge pull request #7000 from Morph1984/create-dir-comment (diff) | |
parent | vk_rasterizer: Fix dynamic StencilOp updating when two faces are enabled (diff) | |
download | yuzu-1bb28dfe2c21dcce7a2c3b189c768c4b74316509.tar yuzu-1bb28dfe2c21dcce7a2c3b189c768c4b74316509.tar.gz yuzu-1bb28dfe2c21dcce7a2c3b189c768c4b74316509.tar.bz2 yuzu-1bb28dfe2c21dcce7a2c3b189c768c4b74316509.tar.lz yuzu-1bb28dfe2c21dcce7a2c3b189c768c4b74316509.tar.xz yuzu-1bb28dfe2c21dcce7a2c3b189c768c4b74316509.tar.zst yuzu-1bb28dfe2c21dcce7a2c3b189c768c4b74316509.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 841a6b846..3bcd6d6cc 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -765,12 +765,7 @@ void RasterizerVulkan::UpdateStencilOp(Tegra::Engines::Maxwell3D::Regs& regs) { const Maxwell::StencilOp zpass = regs.stencil_front_op_zpass; const Maxwell::ComparisonOp compare = regs.stencil_front_func_func; if (regs.stencil_two_side_enable) { - 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)); - }); - } else { + // Separate stencil op per face const Maxwell::StencilOp back_fail = regs.stencil_back_op_fail; const Maxwell::StencilOp back_zfail = regs.stencil_back_op_zfail; 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::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)); + }); } } |