mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Reserve enough space for DXIL constants up front to prevent resizes
This commit is contained in:
@@ -942,6 +942,7 @@ Program::Program(const byte *bytes, size_t length)
|
||||
else if(IS_KNOWN(rootchild.id, KnownBlocks::CONSTANTS_BLOCK))
|
||||
{
|
||||
const Type *t = NULL;
|
||||
m_Constants.reserve(m_Constants.size() + rootchild.children.size());
|
||||
for(const LLVMBC::BlockOrRecord &constant : rootchild.children)
|
||||
{
|
||||
if(constant.IsBlock())
|
||||
|
||||
@@ -446,10 +446,10 @@ void Program::MakeDisassemblyString()
|
||||
if(g.flags & GlobalFlags::IsExternal)
|
||||
m_Disassembly += "external ";
|
||||
}
|
||||
if(!(g.flags & GlobalFlags::IsExternal))
|
||||
m_Disassembly += "internal ";
|
||||
if(g.flags & GlobalFlags::IsAppending)
|
||||
m_Disassembly += "appending ";
|
||||
else if(!(g.flags & GlobalFlags::IsExternal))
|
||||
m_Disassembly += "internal ";
|
||||
if(g.type->addrSpace)
|
||||
m_Disassembly += StringFormat::Fmt("addrspace(%d) ", g.type->addrSpace);
|
||||
if(g.flags & GlobalFlags::LocalUnnamedAddr)
|
||||
@@ -527,7 +527,8 @@ void Program::MakeDisassemblyString()
|
||||
if(m.isConstant && m.constant && m.constant->symbol)
|
||||
ret += m.constant->toString(withTypes);
|
||||
else if(m.isConstant && m.constant &&
|
||||
(m.constant->type->type == Type::Scalar || m.constant->nullconst))
|
||||
(m.constant->type->type == Type::Scalar || m.constant->nullconst ||
|
||||
m.constant->type->name.beginsWith("class.matrix.")))
|
||||
ret += m.constant->toString(withTypes);
|
||||
else
|
||||
ret += StringFormat::Fmt("!%u", GetOrAssignMetaID(&m));
|
||||
|
||||
Reference in New Issue
Block a user