Initial vertex IO fixes

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
This commit is contained in:
Isaac Marovitz 2025-03-21 14:39:39 -04:00
parent 790c8be91b
commit 6c7c8fa87d
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1

View file

@ -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