From e69e8c2a5305b375ab471cb0d8995193ce6498a3 Mon Sep 17 00:00:00 2001 From: chrelliott978 Date: Thu, 8 Jan 2026 00:04:08 +0100 Subject: [PATCH] Guard VK_FORMAT usage with #ifdef __APPLE__ in spirv_emit_context.cpp Fixes Windows build failure where VK_FORMAT_* constants were undefined. The Vulkan header is only included on Apple platforms, so VK_FORMAT usage must also be conditionally compiled with #ifdef __APPLE__. --- src/shader_recompiler/backend/spirv/spirv_emit_context.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index 9d24d35268..76e816933f 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -1681,6 +1681,7 @@ void EmitContext::DefineOutputs(const IR::Program& program) { // Metal requires fragment shader outputs to match render target formats. // On other platforms, always use F32[4] (float vec4) as usual. Id output_type = F32[4]; // Default to float + #ifdef __APPLE__ if (runtime_info.is_moltenvk && index < runtime_info.color_formats.size()) { const auto& format = runtime_info.color_formats[index]; // Check if the render target format is an integer format @@ -1710,6 +1711,7 @@ void EmitContext::DefineOutputs(const IR::Program& program) { output_type = U32[4]; // Use unsigned int vec4 for integer formats } } + #endif // __APPLE__ frag_color[index] = DefineOutput(*this, output_type, std::nullopt); Decorate(frag_color[index], spv::Decoration::Location, index); Name(frag_color[index], fmt::format("frag_color{}", index));