diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp b/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp index 827cb51e9..84759ba82 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode.cpp @@ -2225,17 +2225,39 @@ rdcstr Program::GetValueSymtabString(Value *v) void Program::SetValueSymtabString(Value *v, const rdcstr &s) { if(Constant *c = cast(v)) + { c->str = s; + } else if(Instruction *i = cast(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(v)) + { b->name = s; + } else if(GlobalVar *g = cast(v)) + { g->name = s; + } else if(Function *f = cast(v)) + { f->name = s; + } else if(Alias *a = cast(v)) + { a->name = s; + } } uint32_t Program::GetMetaSlot(const Metadata *m) const