Add component clarifier for multiple outputs

* This prevents multiple outputs being declared with the same name and aliasing.
This commit is contained in:
baldurk
2024-04-02 16:08:20 +01:00
parent 1fe8601769
commit bcf794b019
2 changed files with 12 additions and 0 deletions
@@ -938,6 +938,12 @@ ShaderDebugTrace *Debugger::BeginDebug(DebugAPIWrapper *api, const ShaderStage s
StringFormat::Fmt("_%s%u", isInput ? "input" : "output", decorations[v.id].location);
else
sourceName = StringFormat::Fmt("_sig%u", v.id.value());
for(const DecorationAndParamData &d : decorations[v.id].others)
{
if(d.value == Decoration::Component)
sourceName += StringFormat::Fmt("_%u", d.component);
}
}
const DataType &type = dataTypes[v.type];
@@ -1204,6 +1204,12 @@ void Reflector::MakeReflection(const GraphicsAPI sourceAPI, const ShaderStage st
decorations[global.id].location);
else
name = StringFormat::Fmt("_sig%u", global.id.value());
for(const DecorationAndParamData &d : decorations[global.id].others)
{
if(d.value == Decoration::Component)
name += StringFormat::Fmt("_%u", d.component);
}
}
const bool used = usedIds.find(global.id) != usedIds.end();