From cb240560df0653fe3fef3431e6997dd47cc2c3cf Mon Sep 17 00:00:00 2001 From: goldislead <69987043+goldislead@users.noreply.github.com> Date: Tue, 4 Aug 2026 16:32:00 -0700 Subject: [PATCH] [Vulkan] Fix 2x MSAA alpha-to-coverage sample layout Co-authored-by: Herman S. <429230+has207@users.noreply.github.com> --- src/xenia/gpu/spirv_shader_translator_rb.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xenia/gpu/spirv_shader_translator_rb.cc b/src/xenia/gpu/spirv_shader_translator_rb.cc index f2be2b72b..fb058ad88 100644 --- a/src/xenia/gpu/spirv_shader_translator_rb.cc +++ b/src/xenia/gpu/spirv_shader_translator_rb.cc @@ -4401,8 +4401,11 @@ void SpirvShaderTranslator::FSI_AlphaToMask() { FSI_AlphaToMaskSample(false, 1, 1.0f, threshold_offset, 1.0f / 8.0f, alpha, coverage_2x); } else { - // FBO: Account for native 2x vs 2x-as-4x sample mapping. - if (native_2x_msaa_no_attachments_) { + // FBO: Account for native 2x vs 2x-as-4x sample mapping. This epilogue only + // runs when there is a color attachment (sample mask output), so whether 2x + // is native must be taken from the capability with attachments, matching + // the choice made for the host pipeline. + if (native_2x_msaa_with_attachments_) { // Native 2x: D3D10.1+ standard - top is 1, bottom is 0. FSI_AlphaToMaskSample(true, 1, 0.5f, threshold_offset, 1.0f / 8.0f, alpha, coverage_2x);