Add handling for new DXIL dx.op opcodes

This commit is contained in:
baldurk
2026-07-17 16:14:29 +01:00
parent 630510e360
commit 96978cae62
4 changed files with 262 additions and 4 deletions
+35 -1
View File
@@ -603,7 +603,41 @@ enum class DXOp : uint32_t
SampleCmpBias = 255,
StartVertexLocation = 256,
StartInstanceLocation = 257,
NumOpCodes = 258,
AllocateRayQuery2 = 258,
HitObject_TraceRay = 262,
HitObject_FromRayQuery = 263,
HitObject_FromRayQueryWithAttrs = 264,
HitObject_MakeMiss = 265,
HitObject_MakeNop = 266,
HitObject_Invoke = 267,
MaybeReorderThread = 268,
HitObject_IsMiss = 269,
HitObject_IsHit = 270,
HitObject_IsNop = 271,
HitObject_RayFlags = 272,
HitObject_RayTMin = 273,
HitObject_RayTCurrent = 274,
HitObject_WorldRayOrigin = 275,
HitObject_WorldRayDirection = 276,
HitObject_ObjectRayOrigin = 277,
HitObject_ObjectRayDirection = 278,
HitObject_ObjectToWorld3x4 = 279,
HitObject_WorldToObject3x4 = 280,
HitObject_GeometryIndex = 281,
HitObject_InstanceIndex = 282,
HitObject_InstanceID = 283,
HitObject_PrimitiveIndex = 284,
HitObject_HitKind = 285,
HitObject_ShaderTableIndex = 286,
HitObject_SetShaderTableIndex = 287,
HitObject_LoadLocalRootTableConstant = 288,
HitObject_Attributes = 289,
RawBufferVectorLoad = 303,
RawBufferVectorStore = 304,
VectorReduceAnd = 309,
VectorReduceOr = 310,
FDot = 311,
NumOpCodes,
};
enum class AtomicBinOpCode : uint32_t
+74 -2
View File
@@ -539,7 +539,41 @@ static bool OperationFlushing(const Operation op, DXOp dxOpCode)
case DXOp::NodeOutputIsValid:
case DXOp::GetRemainingRecursionLevels:
case DXOp::StartVertexLocation:
case DXOp::StartInstanceLocation: return false;
case DXOp::StartInstanceLocation:
case DXOp::AllocateRayQuery2:
case DXOp::HitObject_TraceRay:
case DXOp::HitObject_FromRayQuery:
case DXOp::HitObject_FromRayQueryWithAttrs:
case DXOp::HitObject_MakeMiss:
case DXOp::HitObject_MakeNop:
case DXOp::HitObject_Invoke:
case DXOp::MaybeReorderThread:
case DXOp::HitObject_IsMiss:
case DXOp::HitObject_IsHit:
case DXOp::HitObject_IsNop:
case DXOp::HitObject_RayFlags:
case DXOp::HitObject_RayTMin:
case DXOp::HitObject_RayTCurrent:
case DXOp::HitObject_WorldRayOrigin:
case DXOp::HitObject_WorldRayDirection:
case DXOp::HitObject_ObjectRayOrigin:
case DXOp::HitObject_ObjectRayDirection:
case DXOp::HitObject_ObjectToWorld3x4:
case DXOp::HitObject_WorldToObject3x4:
case DXOp::HitObject_GeometryIndex:
case DXOp::HitObject_InstanceIndex:
case DXOp::HitObject_InstanceID:
case DXOp::HitObject_PrimitiveIndex:
case DXOp::HitObject_HitKind:
case DXOp::HitObject_ShaderTableIndex:
case DXOp::HitObject_SetShaderTableIndex:
case DXOp::HitObject_LoadLocalRootTableConstant:
case DXOp::HitObject_Attributes:
case DXOp::RawBufferVectorLoad:
case DXOp::RawBufferVectorStore:
case DXOp::VectorReduceAnd:
case DXOp::VectorReduceOr:
case DXOp::FDot: return false;
case DXOp::NumOpCodes:
RDCERR("Unhandled DXOpCode %s in DXIL shader debugger", ToStr(dxOpCode).c_str());
break;
@@ -4971,7 +5005,7 @@ bool ThreadState::ExecuteInstruction(const rdcarray<ThreadState> &workgroup)
case DXOp::TextureGatherRaw:
// Gather raw elements from 4 texels with no type conversions (SRV type is constrained)
// SM 6.8 : when SM6.8 is supporting by RenderDoc
// SM 6.8
case DXOp::StartVertexLocation:
// SV_BaseVertexLocation
// BaseVertexLocation from DrawIndexedInstanced or StartVertexLocation from DrawInstanced
@@ -4981,6 +5015,10 @@ bool ThreadState::ExecuteInstruction(const rdcarray<ThreadState> &workgroup)
case DXOp::BarrierByMemoryType:
case DXOp::BarrierByMemoryHandle:
// SM 6.9 - could be used with normal vectors
case DXOp::RawBufferVectorLoad:
case DXOp::RawBufferVectorStore:
// No plans to implement
// MSAA
@@ -5008,6 +5046,11 @@ bool ThreadState::ExecuteInstruction(const rdcarray<ThreadState> &workgroup)
case DXOp::MinPrecXRegLoad:
case DXOp::MinPrecXRegStore:
// long vectors
case DXOp::VectorReduceAnd:
case DXOp::VectorReduceOr:
case DXOp::FDot:
// Mesh Shaders
case DXOp::SetMeshOutputCounts:
case DXOp::EmitIndices:
@@ -5101,6 +5144,35 @@ bool ThreadState::ExecuteInstruction(const rdcarray<ThreadState> &workgroup)
case DXOp::RayQuery_CandidateInstanceContributionToHitGroupIndex:
case DXOp::RayQuery_CommittedInstanceContributionToHitGroupIndex:
case DXOp::GeometryIndex:
case DXOp::AllocateRayQuery2:
case DXOp::HitObject_TraceRay:
case DXOp::HitObject_FromRayQuery:
case DXOp::HitObject_FromRayQueryWithAttrs:
case DXOp::HitObject_MakeMiss:
case DXOp::HitObject_MakeNop:
case DXOp::HitObject_Invoke:
case DXOp::MaybeReorderThread:
case DXOp::HitObject_IsMiss:
case DXOp::HitObject_IsHit:
case DXOp::HitObject_IsNop:
case DXOp::HitObject_RayFlags:
case DXOp::HitObject_RayTMin:
case DXOp::HitObject_RayTCurrent:
case DXOp::HitObject_WorldRayOrigin:
case DXOp::HitObject_WorldRayDirection:
case DXOp::HitObject_ObjectRayOrigin:
case DXOp::HitObject_ObjectRayDirection:
case DXOp::HitObject_ObjectToWorld3x4:
case DXOp::HitObject_WorldToObject3x4:
case DXOp::HitObject_GeometryIndex:
case DXOp::HitObject_InstanceIndex:
case DXOp::HitObject_InstanceID:
case DXOp::HitObject_PrimitiveIndex:
case DXOp::HitObject_HitKind:
case DXOp::HitObject_ShaderTableIndex:
case DXOp::HitObject_SetShaderTableIndex:
case DXOp::HitObject_LoadLocalRootTableConstant:
case DXOp::HitObject_Attributes:
// Workgraphs
case DXOp::AllocateNodeOutputRecords:
@@ -481,6 +481,60 @@ static const char *dxOpFunctionNames[] = {
"dx.op.sampleCmpBias",
"dx.op.startVertexLocation",
"dx.op.startInstanceLocation",
"dx.op.allocateRayQuery2",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.hitObject_TraceRay",
"dx.op.hitObject_FromRayQuery",
"dx.op.hitObject_FromRayQueryWithAttrs",
"dx.op.hitObject_MakeMiss",
"dx.op.hitObject_MakeNop",
"dx.op.hitObject_Invoke",
"dx.op.maybeReorderThread",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateVector",
"dx.op.hitObject_StateVector",
"dx.op.hitObject_StateVector",
"dx.op.hitObject_StateVector",
"dx.op.hitObject_StateMatrix",
"dx.op.hitObject_StateMatrix",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_StateScalar",
"dx.op.hitObject_SetShaderTableIndex",
"dx.op.hitObject_LoadLocalRootTableConstant",
"dx.op.hitObject_Attributes",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.reserved",
"dx.op.rawBufferVectorLoad",
"dx.op.rawBufferVectorStore",
"dx.op.matVecMul",
"dx.op.matVecMulAdd",
"dx.op.outerProductAccumulate",
"dx.op.vectorAccumulate",
"dx.op.vectorReduce",
"dx.op.vectorReduce",
"dx.op.dot",
};
static const char *dxcOpNames[] = {
@@ -742,6 +796,60 @@ static const char *dxcOpNames[] = {
"SampleCmpBias(srv,sampler,coord0,coord1,coord2,coord3,offset0,offset1,offset2,compareValue,bias,clamp)",
"StartVertexLocation()",
"StartInstanceLocation()",
"AllocateRayQuery2(constRayFlags,constRayQueryFlags)",
"Reserved()",
"Reserved()",
"Reserved()",
"HitObject_TraceRay(accelerationStructure,rayFlags,instanceInclusionMask,rayContributionToHitGroupIndex,multiplierForGeometryContributionToHitGroupIndex,missShaderIndex,Origin_X,Origin_Y,Origin_Z,TMin,Direction_X,Direction_Y,Direction_Z,TMax,payload)",
"HitObject_FromRayQuery(rayQueryHandle)",
"HitObject_FromRayQueryWithAttrs(rayQueryHandle,HitKind,CommittedAttribs))",
"HitObject_MakeMiss(RayFlags,MissShaderIndex,Origin_X,Origin_Y,Origin_Z,TMin,Direction_X,Direction_Y,Direction_Z,TMax)",
"HitObject_MakeNop()",
"HitObject_Invoke(hitObject,payload)",
"MaybeReorderThread(hitObject,coherenceHint,numCoherenceHintBitsFromLSB)",
"HitObject_IsMiss(hitObject)",
"HitObject_IsHit(hitObject)",
"HitObject_IsNop(hitObject)",
"HitObject_RayFlags(hitObject)",
"HitObject_RayTMin(hitObject)",
"HitObject_RayTCurrent(hitObject)",
"HitObject_WorldRayOrigin(hitObject,component)",
"HitObject_WorldRayDirection(hitObject,component)",
"HitObject_ObjectRayOrigin(hitObject,component)",
"HitObject_ObjectRayDirection(hitObject,component)",
"HitObject_ObjectToWorld3x4(hitObject,row,col)",
"HitObject_WorldToObject3x4(hitObject,row,col)",
"HitObject_GeometryIndex(hitObject)",
"HitObject_InstanceIndex(hitObject)",
"HitObject_InstanceID(hitObject)",
"HitObject_PrimitiveIndex(hitObject)",
"HitObject_HitKind(hitObject)",
"HitObject_ShaderTableIndex(hitObject)",
"HitObject_SetShaderTableIndex(hitObject,shaderTableIndex)",
"HitObject_LoadLocalRootTableConstant(hitObject,offset)",
"HitObject_Attributes(hitObject,attributes)",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"Reserved()",
"RawBufferVectorLoad(buf,index,elementOffset,alignment)",
"RawBufferVectorStore(uav,index,elementOffset,value0,alignment)",
"MatVecMul(inputVector,isInputUnsigned,inputInterpretation,matrixBuffer,matrixOffset,matrixIntepretation,matrixM,matrixK,matrixLayout,matrixTranspose,matrixStride,isOutputUnsigned)",
"MatVecMulAdd(inputVector,isInputUnsigned,inputInterpretation,matrixBuffer,matrixOffset,matrixIntepretation,matrixM,matrixK,matrixLayout,matrixTranspose,matrixStride,biasBuffer,biasOffset,biasIntepretation,isOutputUnsigned)",
"OuterProductAccumulate(inputVector1,inputVector2,matrixBuffer,matrixOffset,matrixIntepretation,matrixLayout,matrixStride)",
"VectorAccumulate(inputVector,arrayBuffer,arrayOffset)",
"VectorReduceAnd(a)",
"VectorReduceOr(a)",
"FDot(a,b)",
};
static const char *funcNameSigs[] = {
@@ -1950,6 +2058,9 @@ void Program::MakeDXCDisassemblyString()
const bool dxcStyleFormatting = true;
const char dxilIdentifier = Program::GetDXILIdentifier(dxcStyleFormatting);
RDCCOMPILE_ASSERT(ARRAY_COUNT(dxcOpNames) == (size_t)DXOp::NumOpCodes,
"dxcOpNames array is not correct!");
m_Disassembly.clear();
#if DISABLED(DXC_COMPATIBLE_DISASM)
m_Disassembly += StringFormat::Fmt("; %s Shader, compiled under SM%u.%u\n\n",
@@ -3023,6 +3134,9 @@ void Program::MakeRDDisassemblyString(const DXBC::Reflection *reflection)
const bool dxcStyleFormatting = m_DXCStyle;
const char dxilIdentifier = Program::GetDXILIdentifier(dxcStyleFormatting);
RDCCOMPILE_ASSERT(ARRAY_COUNT(dxOpFunctionNames) == (size_t)DXOp::NumOpCodes,
"dxOpFunctionNames array is not correct!");
m_Disassembly.clear();
m_DisassemblyInstructionLine = 1;
+39 -1
View File
@@ -1875,7 +1875,7 @@ rdcstr Program::GetDebugStatus()
case DXOp::TextureGatherRaw:
// Gather raw elements from 4 texels with no type conversions (SRV type is constrained)
// SM 6.8 : when SM6.8 is supporting by RenderDoc
// SM 6.8
case DXOp::StartVertexLocation:
// SV_BaseVertexLocation
// BaseVertexLocation from DrawIndexedInstanced or StartVertexLocation from DrawInstanced
@@ -1885,6 +1885,10 @@ rdcstr Program::GetDebugStatus()
case DXOp::BarrierByMemoryType:
case DXOp::BarrierByMemoryHandle:
// SM 6.9 - could be used with normal vectors
case DXOp::RawBufferVectorLoad:
case DXOp::RawBufferVectorStore:
// No plans to implement
// MSAA
@@ -1912,6 +1916,11 @@ rdcstr Program::GetDebugStatus()
case DXOp::MinPrecXRegLoad:
case DXOp::MinPrecXRegStore:
// long vectors
case DXOp::VectorReduceAnd:
case DXOp::VectorReduceOr:
case DXOp::FDot:
// Mesh Shaders
case DXOp::SetMeshOutputCounts:
case DXOp::EmitIndices:
@@ -2005,6 +2014,35 @@ rdcstr Program::GetDebugStatus()
case DXOp::RayQuery_CandidateInstanceContributionToHitGroupIndex:
case DXOp::RayQuery_CommittedInstanceContributionToHitGroupIndex:
case DXOp::GeometryIndex:
case DXOp::AllocateRayQuery2:
case DXOp::HitObject_TraceRay:
case DXOp::HitObject_FromRayQuery:
case DXOp::HitObject_FromRayQueryWithAttrs:
case DXOp::HitObject_MakeMiss:
case DXOp::HitObject_MakeNop:
case DXOp::HitObject_Invoke:
case DXOp::MaybeReorderThread:
case DXOp::HitObject_IsMiss:
case DXOp::HitObject_IsHit:
case DXOp::HitObject_IsNop:
case DXOp::HitObject_RayFlags:
case DXOp::HitObject_RayTMin:
case DXOp::HitObject_RayTCurrent:
case DXOp::HitObject_WorldRayOrigin:
case DXOp::HitObject_WorldRayDirection:
case DXOp::HitObject_ObjectRayOrigin:
case DXOp::HitObject_ObjectRayDirection:
case DXOp::HitObject_ObjectToWorld3x4:
case DXOp::HitObject_WorldToObject3x4:
case DXOp::HitObject_GeometryIndex:
case DXOp::HitObject_InstanceIndex:
case DXOp::HitObject_InstanceID:
case DXOp::HitObject_PrimitiveIndex:
case DXOp::HitObject_HitKind:
case DXOp::HitObject_ShaderTableIndex:
case DXOp::HitObject_SetShaderTableIndex:
case DXOp::HitObject_LoadLocalRootTableConstant:
case DXOp::HitObject_Attributes:
// Workgraphs
case DXOp::AllocateNodeOutputRecords: