From 77597d62ae285fbc5b14a234d24b93aaa5cfd13f Mon Sep 17 00:00:00 2001 From: goldislead <69987043+goldislead@users.noreply.github.com> Date: Fri, 7 Aug 2026 20:12:00 -0700 Subject: [PATCH] [Vulkan] Select back-face stencil ref/mask when culling only front faces They were picked whenever front faces were culled, even with both faces culled. Matches D3D12. Co-authored-by: Herman S. <429230+has207@users.noreply.github.com> --- src/xenia/gpu/vulkan/vulkan_command_processor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.cc b/src/xenia/gpu/vulkan/vulkan_command_processor.cc index 684abaf56..d65f7276c 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.cc +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.cc @@ -4712,8 +4712,9 @@ void VulkanCommandProcessor::UpdateDynamicState( stencil_ref_mask_back_reg = XE_GPU_REG_RB_STENCILREFMASK_BF; } else { // Choose the back face values only if drawing only back faces. + auto pa_su_sc_mode_cntl = regs.Get(); stencil_ref_mask_front_reg = - regs.Get().cull_front + (pa_su_sc_mode_cntl.cull_front && !pa_su_sc_mode_cntl.cull_back) ? XE_GPU_REG_RB_STENCILREFMASK_BF : XE_GPU_REG_RB_STENCILREFMASK; stencil_ref_mask_back_reg = stencil_ref_mask_front_reg;