mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-10 20:10:33 +00:00
For DXIL Disassembly change "." -> "_" in Instruction names
Disabled when DXC_COMPATIBLE_DISASM is enabled The shader debugger treats "." in a variable name as a field separator
This commit is contained in:
@@ -2225,17 +2225,39 @@ rdcstr Program::GetValueSymtabString(Value *v)
|
||||
void Program::SetValueSymtabString(Value *v, const rdcstr &s)
|
||||
{
|
||||
if(Constant *c = cast<Constant>(v))
|
||||
{
|
||||
c->str = s;
|
||||
}
|
||||
else if(Instruction *i = cast<Instruction>(v))
|
||||
i->extra(alloc).name = s;
|
||||
{
|
||||
#if DISABLED(DXC_COMPATIBLE_DISASM)
|
||||
// For instruction names convert "." -> "_" to allow the name to be used as debugger variable name
|
||||
// "." is treated as a field separator by the debugger
|
||||
rdcstr &str = i->extra(alloc).name;
|
||||
str = s;
|
||||
for(size_t j = 0; j < str.size(); ++j)
|
||||
{
|
||||
if(str[j] == '.')
|
||||
str[j] = '_';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if(Block *b = cast<Block>(v))
|
||||
{
|
||||
b->name = s;
|
||||
}
|
||||
else if(GlobalVar *g = cast<GlobalVar>(v))
|
||||
{
|
||||
g->name = s;
|
||||
}
|
||||
else if(Function *f = cast<Function>(v))
|
||||
{
|
||||
f->name = s;
|
||||
}
|
||||
else if(Alias *a = cast<Alias>(v))
|
||||
{
|
||||
a->name = s;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t Program::GetMetaSlot(const Metadata *m) const
|
||||
|
||||
Reference in New Issue
Block a user