Skip to content

Commit b8f77d8

Browse files
committed
RD DXIL Disassembly: EntryPoint Resources output
Includes EntryPoint Resources parsing Includes handling column index for inputs/outputs access
1 parent b8621e8 commit b8f77d8

File tree

5 files changed

+428
-42
lines changed

5 files changed

+428
-42
lines changed

renderdoc/driver/shaders/dxbc/dxbc_container.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ const rdcstr &DXBCContainer::GetDisassembly(bool dxcStyle)
610610
m_Disassembly += "\n\n";
611611
#endif
612612

613-
m_Disassembly += m_DXILByteCode->GetDisassembly(dxcStyle);
613+
m_Disassembly += m_DXILByteCode->GetDisassembly(dxcStyle, m_Reflection);
614614
}
615615
}
616616

renderdoc/driver/shaders/dxil/dxil_bytecode.h

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,11 +1159,61 @@ struct EntryPoint
11591159
int32_t startCol;
11601160
};
11611161

1162+
struct ResourceBase
1163+
{
1164+
ResourceBase(const Metadata *resourceBase);
1165+
uint32_t id;
1166+
const Type *type;
1167+
rdcstr name;
1168+
uint32_t space;
1169+
uint32_t regBase;
1170+
uint32_t regCount;
1171+
};
1172+
1173+
struct SRV : ResourceBase
1174+
{
1175+
SRV(const Metadata *srv);
1176+
ResourceKind shape;
1177+
uint32_t sampleCount;
1178+
ComponentType compType;
1179+
uint32_t elementStride;
1180+
};
1181+
1182+
struct UAV : ResourceBase
1183+
{
1184+
UAV(const Metadata *uav);
1185+
ResourceKind shape;
1186+
bool globallCoherent;
1187+
bool hasCounter;
1188+
bool rasterizerOrderedView;
1189+
ComponentType compType;
1190+
uint32_t elementStride;
1191+
SamplerFeedbackType samplerFeedback;
1192+
bool atomic64Use;
1193+
};
1194+
1195+
struct CBuffer : ResourceBase
1196+
{
1197+
CBuffer(const Metadata *cbuffer);
1198+
uint32_t sizeInBytes;
1199+
bool isTBuffer;
1200+
};
1201+
1202+
struct Sampler : ResourceBase
1203+
{
1204+
Sampler(const Metadata *sampler);
1205+
SamplerKind samplerType;
1206+
};
1207+
11621208
rdcstr name;
11631209
const Type *function;
11641210
rdcarray<Signature> inputs;
11651211
rdcarray<Signature> outputs;
11661212
rdcarray<Signature> patchConstants;
1213+
rdcarray<SRV> srvs;
1214+
rdcarray<UAV> uavs;
1215+
rdcarray<CBuffer> cbuffers;
1216+
rdcarray<Sampler> samplers;
11671217
};
11681218

11691219
class Program : public DXBC::IDebugInfo
@@ -1184,7 +1234,7 @@ class Program : public DXBC::IDebugInfo
11841234
uint32_t GetMajorVersion() const { return m_Major; }
11851235
uint32_t GetMinorVersion() const { return m_Minor; }
11861236
D3D_PRIMITIVE_TOPOLOGY GetOutputTopology();
1187-
const rdcstr &GetDisassembly(bool dxcStyle);
1237+
const rdcstr &GetDisassembly(bool dxcStyle, const DXBC::Reflection *reflection);
11881238

11891239
// IDebugInfo interface
11901240

@@ -1204,7 +1254,7 @@ class Program : public DXBC::IDebugInfo
12041254
protected:
12051255
void SettleIDs();
12061256
void MakeDXCDisassemblyString();
1207-
void MakeRDDisassemblyString();
1257+
void MakeRDDisassemblyString(const DXBC::Reflection *reflection);
12081258

12091259
void ParseConstant(ValueList &values, const LLVMBC::BlockOrRecord &constant);
12101260
bool ParseDebugMetaRecord(MetadataList &metadata, const LLVMBC::BlockOrRecord &metaRecord,

renderdoc/driver/shaders/dxil/dxil_common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ enum class ResourceKind
8383
SamplerComparison,
8484
};
8585

86+
enum class SamplerKind
87+
{
88+
Default = 0,
89+
Comparison,
90+
Mono,
91+
Invalid,
92+
};
93+
8694
enum class ShaderEntryTag
8795
{
8896
ShaderFlags = 0,

0 commit comments

Comments
 (0)