[VK, MacOS] Fix strict output type mismatch on Metal (MK8D/TOTK fix) (#3414)

Metal validation requires fragment shader output types to strictly match the render target format (e.g., writing float to RGBA32Uint is invalid).

This commit:
1. Adds color_output_types to RuntimeInfo.
2. Detects Integer/SignedInteger render targets in the Vulkan backend (MoltenVK only).
3. Updates the SPIR-V emitter to declare the correct output type (Uint/Sint) and bitcast values accordingly.

This fixes the VK_ERROR_INITIALIZATION_FAILED crash on macOS.

Co-authored-by: crueter <crueter@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3414
Co-authored-by: rayman30 <silentbitdev@gmail.com>
Co-committed-by: rayman30 <silentbitdev@gmail.com>
This commit is contained in:
rayman30 2026-01-29 17:24:36 +01:00 committed by crueter
parent 025bc799f7
commit 643f11d972
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
4 changed files with 42 additions and 4 deletions

View file

@ -1677,7 +1677,8 @@ void EmitContext::DefineOutputs(const IR::Program& program) {
if (!info.stores_frag_color[index] && !profile.need_declared_frag_colors) {
continue;
}
frag_color[index] = DefineOutput(*this, F32[4], std::nullopt);
const Id type{GetAttributeType(*this, runtime_info.color_output_types[index])};
frag_color[index] = DefineOutput(*this, type, std::nullopt);
Decorate(frag_color[index], spv::Decoration::Location, index);
Name(frag_color[index], fmt::format("frag_color{}", index));
}