Skip to content

Commit

Permalink
Fix stencil enabling in pipeline state
Browse files Browse the repository at this point in the history
Summary: Fix stencil enabling in pipeline state

Reviewed By: mmaurer

Differential Revision: D52217293

fbshipit-source-id: ea95a84e7064177290d40687d70a948c73355b32
  • Loading branch information
Roman Kuznetsov authored and corporateshark committed Dec 20, 2023
1 parent 8d2ea82 commit 76d31ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lvk/vulkan/VulkanClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,12 @@ lvk::VulkanPipelineBuilder& lvk::VulkanPipelineBuilder::stencilStateOps(VkStenci
VkStencilOp passOp,
VkStencilOp depthFailOp,
VkCompareOp compareOp) {
depthStencilState_.stencilTestEnable = depthStencilState_.stencilTestEnable == VK_TRUE || failOp != VK_STENCIL_OP_KEEP ||
passOp != VK_STENCIL_OP_KEEP || depthFailOp != VK_STENCIL_OP_KEEP ||
compareOp != VK_COMPARE_OP_ALWAYS
? VK_TRUE
: VK_FALSE;

if (faceMask & VK_STENCIL_FACE_FRONT_BIT) {
VkStencilOpState& s = depthStencilState_.front;
s.failOp = failOp;
Expand Down

0 comments on commit 76d31ec

Please sign in to comment.