diff --git a/XenosRecomp/shader_recompiler.cpp b/XenosRecomp/shader_recompiler.cpp index 70e1fc9..c26f352 100644 --- a/XenosRecomp/shader_recompiler.cpp +++ b/XenosRecomp/shader_recompiler.cpp @@ -1360,13 +1360,15 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi out += "#if __air__\n"; - out += "struct StageIn\n"; - out += "{\n"; + if (isPixelShader) { + out += "struct StageIn\n"; + out += "{\n"; - for (auto& [usage, usageIndex] : INTERPOLATORS) - println("\tfloat4 i{}{};", USAGE_VARIABLES[uint32_t(usage)], usageIndex); + for (auto& [usage, usageIndex] : INTERPOLATORS) + println("\tfloat4 i{}{};", USAGE_VARIABLES[uint32_t(usage)], usageIndex); - out += "};\n"; + out += "};\n"; + } if (isPixelShader) out += "[[fragment]]\n"; @@ -1479,8 +1481,13 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi #ifdef UNLEASHED_RECOMP if (hasIndexCount) { + out += "#ifdef __air__\n"; + out += "\tuint iVertexId [[vertex_id]],\n"; + out += "\tuint iInstanceId [[instance_id]],\n"; + out += "#else\n"; out += "\tin uint iVertexId : SV_VertexID,\n"; out += "\tin uint iInstanceId : SV_InstanceID,\n"; + out += "#endif\n"; } #endif