mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-20 12:38:59 +02:00
[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:
parent
025bc799f7
commit
643f11d972
4 changed files with 42 additions and 4 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue