From 5ddc889d8da8f6d811a0665b3a7ee9bde76ea3a0 Mon Sep 17 00:00:00 2001 From: JPikachu Date: Sun, 29 Jun 2025 17:16:47 +0000 Subject: [PATCH] [vk] Enable trivial stencil for games like EOW (#234) Fixes rift clipping in LoZ: EOW + possible fixes for other games. NOTE: Flickering may occur, this is for testing purposes. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/234 Co-authored-by: JPikachu Co-committed-by: JPikachu --- src/video_core/renderer_vulkan/blit_image.cpp | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 7fb428d996..ddbb5581f0 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -189,9 +192,25 @@ constexpr VkPipelineDepthStencilStateCreateInfo PIPELINE_DEPTH_STENCIL_STATE_CRE .depthWriteEnable = VK_TRUE, .depthCompareOp = VK_COMPARE_OP_ALWAYS, .depthBoundsTestEnable = VK_FALSE, - .stencilTestEnable = VK_FALSE, - .front = VkStencilOpState{}, - .back = VkStencilOpState{}, + .stencilTestEnable = VK_TRUE, + .front = VkStencilOpState{ + .failOp = VK_STENCIL_OP_REPLACE, + .passOp = VK_STENCIL_OP_REPLACE, + .depthFailOp = VK_STENCIL_OP_KEEP, + .compareOp = VK_COMPARE_OP_ALWAYS, + .compareMask = 0x0, + .writeMask = 0xFFFFFFFF, + .reference = 0x00, + }, + .back = VkStencilOpState{ + .failOp = VK_STENCIL_OP_REPLACE, + .passOp = VK_STENCIL_OP_REPLACE, + .depthFailOp = VK_STENCIL_OP_KEEP, + .compareOp = VK_COMPARE_OP_ALWAYS, + .compareMask = 0x0, + .writeMask = 0xFFFFFFFF, + .reference = 0x00, + }, .minDepthBounds = 0.0f, .maxDepthBounds = 0.0f, };