Skip to content

Commit

Permalink
Fix crash disassembling root signature in DXIL metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Nov 1, 2023
1 parent 8805afd commit b103d1f
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions renderdoc/driver/shaders/dxil/dxil_disassemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2030,28 +2030,35 @@ rdcstr Constant::toString(bool withType) const
}
else if(type->type == Type::Array)
{
ret += "[";
for(size_t i = 0; i < members->size(); i++)
if(!members && !str.empty())
{
if(i > 0)
ret += ", ";

if(Literal *l = cast<Literal>(members->at(i)))
ret += "c" + escapeString(str);
}
else
{
ret += "[";
for(size_t i = 0; i < members->size(); i++)
{
if(withType)
ret += type->inner->toString() + " ";
if(i > 0)
ret += ", ";

ShaderValue v;
v.u64v[0] = l->literal;
if(Literal *l = cast<Literal>(members->at(i)))
{
if(withType)
ret += type->inner->toString() + " ";

shaderValAppendToString(type->inner, v, 0, ret);
}
else
{
ret += members->at(i)->toString(withType);
ShaderValue v;
v.u64v[0] = l->literal;

shaderValAppendToString(type->inner, v, 0, ret);
}
else
{
ret += members->at(i)->toString(withType);
}
}
ret += "]";
}
ret += "]";
}
else if(type->type == Type::Struct)
{
Expand Down

0 comments on commit b103d1f

Please sign in to comment.