mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Add option for DXIL toString() helpers to use dxcStyle (default)
This commit is contained in:
@@ -111,7 +111,7 @@ struct Type
|
||||
static void *operator new(size_t count, BumpAllocator &b) { return b.alloc(count); }
|
||||
static void operator delete(void *ptr, BumpAllocator &b) {}
|
||||
bool isVoid() const { return type == Scalar && scalarType == Void; }
|
||||
rdcstr toString() const;
|
||||
rdcstr toString(bool dxcStyle = true) const;
|
||||
rdcstr declFunction(rdcstr funcName, const rdcarray<Instruction *> &args,
|
||||
const AttributeSet *attrs) const;
|
||||
|
||||
|
||||
@@ -1538,7 +1538,7 @@ void Program::MakeRDDisassemblyString()
|
||||
m_Disassembly += "\n";
|
||||
}
|
||||
|
||||
rdcstr Type::toString() const
|
||||
rdcstr Type::toString(bool dxcStyle) const
|
||||
{
|
||||
if(!name.empty())
|
||||
{
|
||||
@@ -1563,7 +1563,13 @@ rdcstr Type::toString() const
|
||||
}
|
||||
}
|
||||
}
|
||||
case Vector: return StringFormat::Fmt("<%u x %s>", elemCount, inner->toString().c_str());
|
||||
case Vector:
|
||||
{
|
||||
if(dxcStyle)
|
||||
return StringFormat::Fmt("<%u x %s>", elemCount, inner->toString().c_str());
|
||||
else
|
||||
return StringFormat::Fmt("%s%u", inner->toString().c_str(), elemCount);
|
||||
}
|
||||
case Pointer:
|
||||
{
|
||||
if(inner->type == Type::Function)
|
||||
@@ -1578,7 +1584,13 @@ rdcstr Type::toString() const
|
||||
else
|
||||
return StringFormat::Fmt("%s addrspace(%d)*", inner->toString().c_str(), addrSpace);
|
||||
}
|
||||
case Array: return StringFormat::Fmt("[%u x %s]", elemCount, inner->toString().c_str());
|
||||
case Array:
|
||||
{
|
||||
if(dxcStyle)
|
||||
return StringFormat::Fmt("[%u x %s]", elemCount, inner->toString().c_str());
|
||||
else
|
||||
return StringFormat::Fmt("%s[%u]", inner->toString().c_str(), elemCount);
|
||||
}
|
||||
case Function: return declFunction(rdcstr(), {}, NULL) + "*";
|
||||
case Struct:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user