mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-14 18:00:54 +00:00
RD DXIL Disassembly: tweaks to label formatting
Add the DXIL::Identifier before labels for consistency Do not display predicate "_0" Change predicate column to 30 instead of 50
This commit is contained in:
1 parent
139167a001
commit
2dcb0d0364
1 file changed
+19
-10
@@ -3959,28 +3959,37 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
|
||||
rdcstr labelName;
|
||||
|
||||
if(func.blocks[curBlock]->name.empty())
|
||||
labelName = StringFormat::Fmt("; <label>:%u", func.blocks[curBlock]->slot);
|
||||
labelName = StringFormat::Fmt("; <label>:%c%u ", DXIL::dxilIdentifier,
|
||||
func.blocks[curBlock]->slot);
|
||||
else
|
||||
labelName =
|
||||
StringFormat::Fmt("%s: ", escapeStringIfNeeded(func.blocks[curBlock]->name).c_str());
|
||||
labelName = StringFormat::Fmt("%c%s: ", DXIL::dxilIdentifier,
|
||||
escapeStringIfNeeded(func.blocks[curBlock]->name).c_str());
|
||||
|
||||
labelName.reserve(50);
|
||||
while(labelName.size() < 50)
|
||||
labelName.reserve(30);
|
||||
while(labelName.size() < 30)
|
||||
labelName.push_back(' ');
|
||||
|
||||
labelName += "; preds = ";
|
||||
rdcstr predicates;
|
||||
bool first = true;
|
||||
for(const Block *pred : func.blocks[curBlock]->preds)
|
||||
{
|
||||
if(!first)
|
||||
labelName += ", ";
|
||||
predicates += ", ";
|
||||
first = false;
|
||||
if(pred->name.empty())
|
||||
labelName += StringFormat::Fmt("%c%u", DXIL::dxilIdentifier, pred->slot);
|
||||
{
|
||||
// Ignore predicate 0
|
||||
if(pred->slot > 0)
|
||||
predicates += StringFormat::Fmt("%c%u", DXIL::dxilIdentifier, pred->slot);
|
||||
}
|
||||
else
|
||||
labelName += StringFormat::Fmt("%c%s", DXIL::dxilIdentifier,
|
||||
escapeStringIfNeeded(pred->name).c_str());
|
||||
{
|
||||
predicates += StringFormat::Fmt("%c%s", DXIL::dxilIdentifier,
|
||||
escapeStringIfNeeded(pred->name).c_str());
|
||||
}
|
||||
}
|
||||
if(!predicates.empty())
|
||||
labelName += "; preds = " + predicates;
|
||||
|
||||
m_Disassembly += labelName;
|
||||
DisassemblyAddNewLine();
|
||||
|
||||
Reference in new issue
Block a user