mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
vulkan: stencils use the same reversed compare mode convention as other backends
This commit is contained in:
@@ -901,7 +901,7 @@ void Graphics::setStencilMode(StencilAction action, CompareMode compare, int val
|
|||||||
commandBuffers.at(currentFrame),
|
commandBuffers.at(currentFrame),
|
||||||
VK_STENCIL_FRONT_AND_BACK,
|
VK_STENCIL_FRONT_AND_BACK,
|
||||||
VK_STENCIL_OP_KEEP, Vulkan::getStencilOp(action),
|
VK_STENCIL_OP_KEEP, Vulkan::getStencilOp(action),
|
||||||
VK_STENCIL_OP_KEEP, Vulkan::getCompareOp(compare));
|
VK_STENCIL_OP_KEEP, Vulkan::getCompareOp(getReversedCompareMode(compare)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
states.back().stencil.action = action;
|
states.back().stencil.action = action;
|
||||||
@@ -1109,7 +1109,7 @@ void Graphics::initDynamicState()
|
|||||||
commandBuffers.at(currentFrame),
|
commandBuffers.at(currentFrame),
|
||||||
VK_STENCIL_FRONT_AND_BACK,
|
VK_STENCIL_FRONT_AND_BACK,
|
||||||
VK_STENCIL_OP_KEEP, Vulkan::getStencilOp(states.back().stencil.action),
|
VK_STENCIL_OP_KEEP, Vulkan::getStencilOp(states.back().stencil.action),
|
||||||
VK_STENCIL_OP_KEEP, Vulkan::getCompareOp(states.back().stencil.compare));
|
VK_STENCIL_OP_KEEP, Vulkan::getCompareOp(getReversedCompareMode(states.back().stencil.compare)));
|
||||||
|
|
||||||
vkCmdSetDepthCompareOpEXT(
|
vkCmdSetDepthCompareOpEXT(
|
||||||
commandBuffers.at(currentFrame), Vulkan::getCompareOp(states.back().depthTest));
|
commandBuffers.at(currentFrame), Vulkan::getCompareOp(states.back().depthTest));
|
||||||
@@ -2686,12 +2686,12 @@ VkPipeline Graphics::createGraphicsPipeline(GraphicsPipelineConfiguration &confi
|
|||||||
depthStencil.front.failOp = VK_STENCIL_OP_KEEP;
|
depthStencil.front.failOp = VK_STENCIL_OP_KEEP;
|
||||||
depthStencil.front.passOp = Vulkan::getStencilOp(configuration.dynamicState.stencilAction);
|
depthStencil.front.passOp = Vulkan::getStencilOp(configuration.dynamicState.stencilAction);
|
||||||
depthStencil.front.depthFailOp = VK_STENCIL_OP_KEEP;
|
depthStencil.front.depthFailOp = VK_STENCIL_OP_KEEP;
|
||||||
depthStencil.front.compareOp = Vulkan::getCompareOp(configuration.dynamicState.stencilCompare);
|
depthStencil.front.compareOp = Vulkan::getCompareOp(getReversedCompareMode(configuration.dynamicState.stencilCompare));
|
||||||
|
|
||||||
depthStencil.back.failOp = VK_STENCIL_OP_KEEP;
|
depthStencil.back.failOp = VK_STENCIL_OP_KEEP;
|
||||||
depthStencil.back.passOp = Vulkan::getStencilOp(configuration.dynamicState.stencilAction);
|
depthStencil.back.passOp = Vulkan::getStencilOp(configuration.dynamicState.stencilAction);
|
||||||
depthStencil.back.depthFailOp = VK_STENCIL_OP_KEEP;
|
depthStencil.back.depthFailOp = VK_STENCIL_OP_KEEP;
|
||||||
depthStencil.back.compareOp = Vulkan::getCompareOp(configuration.dynamicState.stencilCompare);
|
depthStencil.back.compareOp = Vulkan::getCompareOp(getReversedCompareMode(configuration.dynamicState.stencilCompare));
|
||||||
}
|
}
|
||||||
|
|
||||||
pipelineInfo.pDepthStencilState = &depthStencil;
|
pipelineInfo.pDepthStencilState = &depthStencil;
|
||||||
|
|||||||
Reference in New Issue
Block a user