shader_recompiler: Fix alpha-to-coverage fragment output interface

The Vulkan spec requires fragment shaders to declare an output covering
Location 0, Component 3 (alpha) when alpha-to-coverage is enabled. This change:

- Tracks alpha_to_coverage_enabled through RuntimeInfo from pipeline state
- Forces declaration of frag_color[0] with full RGBA when enabled
- Initializes alpha to 1.0 in shader epilogue if not explicitly written

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-10-17 16:07:35 +10:00
parent 7dea15e642
commit d8d54c5ccf
5 changed files with 34 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
@@ -227,6 +228,7 @@ Shader::RuntimeInfo MakeRuntimeInfo(std::span<const Shader::IR::Program> program
info.alpha_test_func = MaxwellToCompareFunction(
key.state.UnpackComparisonOp(key.state.alpha_test_func.Value()));
info.alpha_test_reference = Common::BitCast<float>(key.state.alpha_test_ref);
info.alpha_to_coverage_enabled = key.state.alpha_to_coverage_enabled != 0;
break;
default:
break;