[Vulkan] Fix stencil bit transfer shaders not discarding pixels

"packed" was never set because source_depth_texture isn't created for
stencil bit output. This caused the discard logic to be skipped
resulting in stencil being incorrectly incremented on every transfer
draw until it saturated at 0xFF.

Fixes many remaining Vulkan rendering issues, e.g. Brothers, Orange Box,
Arkham Origins, many others.
This commit is contained in:
Herman S.
2025-12-22 00:45:07 +09:00
parent 878de4c352
commit 24f90c0efc

View File

@@ -3741,6 +3741,10 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader(
}
}
}
// For stencil bit output, use stencil directly for the discard check.
if (packed == spv::NoResult && mode.output == TransferOutput::kStencilBit) {
packed = source_stencil[0];
}
switch (mode.output) {
case TransferOutput::kColor: {
// Unless a special path was taken, unpack the raw 32bpp value into the