Skip to content

Commit 13ccbe2

Browse files
committed
RD DXIL Disassembly: decode "dx.op.textureStore"
Example Output call void @dx.op.textureStore.f32(i32 67, %dx.types.Handle %OutLuma_UAV_2d, i32 %1, i32 %2, i32 undef, float %18, float %18, float %18, float %18, i8 15) Becomes OutLuma[_1, _2] = {_18, _18, _18, _18};
1 parent d1150f2 commit 13ccbe2

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

renderdoc/driver/shaders/dxil/dxil_disassemble.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,6 +2978,50 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
29782978
showDxFuncName = true;
29792979
}
29802980
}
2981+
else if(showDxFuncName && funcCallName.beginsWith("dx.op.textureStore"))
2982+
{
2983+
// srv,coord0,coord1,coord2,value0,value1,value2,value3,mask
2984+
showDxFuncName = false;
2985+
uint32_t dxopCode;
2986+
RDCASSERT(getival<uint32_t>(inst.args[0], dxopCode));
2987+
RDCASSERTEQUAL(dxopCode, 67);
2988+
rdcstr handleStr = ArgToString(inst.args[1], false);
2989+
if(resHandles.count(handleStr) > 0)
2990+
{
2991+
lineStr += resHandles[handleStr].name;
2992+
lineStr += "[";
2993+
bool needComma = false;
2994+
for(uint32_t a = 2; a < 5; ++a)
2995+
{
2996+
if(!isUndef(inst.args[a]))
2997+
{
2998+
if(needComma)
2999+
lineStr += ", ";
3000+
lineStr += ArgToString(inst.args[a], false);
3001+
needComma = true;
3002+
}
3003+
}
3004+
lineStr += "]";
3005+
lineStr += " = ";
3006+
lineStr += "{";
3007+
needComma = false;
3008+
for(uint32_t a = 5; a < 9; ++a)
3009+
{
3010+
if(!isUndef(inst.args[a]))
3011+
{
3012+
if(needComma)
3013+
lineStr += ", ";
3014+
lineStr += ArgToString(inst.args[a], false);
3015+
needComma = true;
3016+
}
3017+
}
3018+
lineStr += "}";
3019+
}
3020+
else
3021+
{
3022+
showDxFuncName = true;
3023+
}
3024+
}
29813025
else if(funcCallName.beginsWith("llvm.dbg."))
29823026
{
29833027
}

0 commit comments

Comments
 (0)