mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Generate consistent names for unnamed shader I/O signatures
This commit is contained in:
@@ -542,6 +542,8 @@ ShaderDebugTrace *Debugger::BeginDebug(DebugAPIWrapper *apiWrapper, const Shader
|
||||
else if(decorations[v.id].flags & Decorations::HasLocation)
|
||||
sourceName =
|
||||
StringFormat::Fmt("_%s%u", isInput ? "input" : "output", decorations[v.id].location);
|
||||
else
|
||||
sourceName = StringFormat::Fmt("_sig%u", v.id.value());
|
||||
}
|
||||
|
||||
const DataType &type = dataTypes[v.type];
|
||||
|
||||
@@ -769,9 +769,17 @@ void Reflector::MakeReflection(const GraphicsAPI sourceAPI, const ShaderStage st
|
||||
if(name.empty() && baseType.type == DataType::StructType)
|
||||
name = baseType.name;
|
||||
|
||||
// otherwise fall back to naming after the ID
|
||||
// otherwise fall back to naming after the builtin or location
|
||||
if(name.empty())
|
||||
name = StringFormat::Fmt("sig%u", global.id.value());
|
||||
{
|
||||
if(decorations[global.id].flags & Decorations::HasBuiltIn)
|
||||
name = StringFormat::Fmt("_%s", ToStr(decorations[global.id].builtIn).c_str());
|
||||
else if(decorations[global.id].flags & Decorations::HasLocation)
|
||||
name = StringFormat::Fmt("_%s%u", isInput ? "input" : "output",
|
||||
decorations[global.id].location);
|
||||
else
|
||||
name = StringFormat::Fmt("_sig%u", global.id.value());
|
||||
}
|
||||
|
||||
const bool used = usedIds.find(global.id) != usedIds.end();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user