Skip to content

Commit 756a980

Browse files
committed
RD DXIL Disassembly: ignore first getelemenptr index if it is zero
Before GroupShared float* _30 = shared_pos[0] + _29; After GroupShared float* _30 = shared_pos[_29];
1 parent b8f77d8 commit 756a980

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

renderdoc/driver/shaders/dxil/dxil_disassemble.cpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2786,18 +2786,33 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
27862786

27872787
lineStr += ptrStr;
27882788
// arg[1] : index 0
2789+
bool first = true;
27892790
if(inst.args.size() > 1)
27902791
{
2791-
lineStr += "[";
2792-
lineStr += ArgToString(inst.args[1], false);
2793-
lineStr += "]";
2792+
if(getival<uint32_t>(inst.args[1]) > 0)
2793+
{
2794+
lineStr += "[";
2795+
lineStr += ArgToString(inst.args[1], false);
2796+
lineStr += "]";
2797+
first = false;
2798+
}
27942799
}
27952800

27962801
// arg[2..] : index 1...N
27972802
for(size_t a = 2; a < inst.args.size(); ++a)
27982803
{
2799-
lineStr += " + ";
2804+
if(first)
2805+
lineStr += "[";
2806+
else
2807+
lineStr += " + ";
2808+
28002809
lineStr += ArgToString(inst.args[a], false);
2810+
2811+
if(first)
2812+
{
2813+
lineStr += "]";
2814+
first = false;
2815+
}
28012816
}
28022817
}
28032818
}

0 commit comments

Comments
 (0)