mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-06 01:44:23 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user