Convert the DXIL addrspace value into string
Hand de-mangle pointer name
DXC:
%3 = getelementptr [6 x float], [6 x float] addrspace(3)* @"\01?s_x@@3@$$A.1dim", i32 0, i32 %9
RD:
GroupShared float* _3 = s_x[0] + _9;
Shows entry point inputs & outputs
Decodes "dx.op.loadInput" and "dx.op.StoreOutput" to show the input/output name
Change identifier prefix to "_" instead of "%"
Print floats in more natural format using %#g
Print type before assignments
* These will not be in the reflection data, so we can't try to process them and
fill out their variables as there won't be anything to map to.
* Signature elements which are 'unused' by not being referenced but are present
in a pre-1.4 SPIR-V module will be considered used still.
Capture the mappings into a type usage tree
Update elements of the tree as overlapping mappings are encountered, sub-elements of a previously mapped variable i.e. single component of a vector, single array element, member in a structure.
After processing all mappings convert the finalized type usage tree into source variable mappings.
Loop over the scope downwards (parent -> child) then inside that loop iterate upwards from the current scope (child -> parent) to detect mappings which might be superseded
Generated using DirectShaderCompile python file "utils/hct/hctdb.py"
for inst in db.instr:
out = inst.name
out += "("
for i in range(2,len(inst.ops)):
if i > 2:
out += ","
op = inst.ops[i]
out += op.name
out += ")"
print(out)
Disable dxcStyleFormatting when making RD disassembly
Change float printing to use "%#g" when dxcStyleFormatting is disabled
Before (DXC style)
%7 = fmul fast float %4, 2.000000e+00
%14 = fcmp fast olt float %13, 1.000000e-06
After (RD style)
%7 = fmul fast float %4, 2.00000;
%14 = fcmp fast olt float %13, 1.00000e-06;
First pass to settle the IDs common between disassembly styles
Second pass to display the disassembly
Divide existing MakeDXCDisassemblyString() method into helper methods to be shared
Currently not exposed to the UI and code uses the existing DXC compatibile DXIL disassembly
Add bool parameter to DXBC::GetDisassembly()
Add bool parameter to DXIL::GetDisassembly()
Add void DXIL::MakeDXCDisassemblyString()
Add void DXIL::MakeRDDisassemblyString()