Skip to content

Commit

Permalink
DXIL Debugger support for SV_ related ops
Browse files Browse the repository at this point in the history
DXOp::SampleIndex
DXOp::Coverage
DXOp::InnerCoverage
DXOp::ViewID
DXOp::PrimitiveID
  • Loading branch information
Zorro666 committed Dec 11, 2024
1 parent 4c880eb commit 8de9c1d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
45 changes: 40 additions & 5 deletions renderdoc/driver/shaders/dxil/dxil_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3156,6 +3156,46 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
result.value = a.value;
break;
}
case DXOp::SampleIndex:
{
// SV_SampleIndex
RDCASSERT(m_GlobalState.builtinInputs.count(ShaderBuiltin::MSAASampleIndex) != 0);
result.value.u32v[0] =
m_GlobalState.builtinInputs.at(ShaderBuiltin::MSAASampleIndex).value.u32v[0];
break;
}
case DXOp::Coverage:
{
// SV_Coverage
RDCASSERT(m_GlobalState.builtinInputs.count(ShaderBuiltin::MSAACoverage) != 0);
result.value.u32v[0] =
m_GlobalState.builtinInputs.at(ShaderBuiltin::MSAACoverage).value.u32v[0];
break;
}
case DXOp::InnerCoverage:
{
// SV_InnerCoverage
RDCASSERT(m_GlobalState.builtinInputs.count(ShaderBuiltin::IsFullyCovered) != 0);
result.value.u32v[0] =
m_GlobalState.builtinInputs.at(ShaderBuiltin::IsFullyCovered).value.u32v[0];
break;
}
case DXOp::ViewID:
{
// SV_ViewportArrayIndex
RDCASSERT(m_GlobalState.builtinInputs.count(ShaderBuiltin::ViewportIndex) != 0);
result.value.u32v[0] =
m_GlobalState.builtinInputs.at(ShaderBuiltin::ViewportIndex).value.u32v[0];
break;
}
case DXOp::PrimitiveID:
{
// SV_PrimitiveID
RDCASSERT(m_GlobalState.builtinInputs.count(ShaderBuiltin::PrimitiveIndex) != 0);
result.value.u32v[0] =
m_GlobalState.builtinInputs.at(ShaderBuiltin::PrimitiveIndex).value.u32v[0];
break;
}
case DXOp::IsHelperLane:
{
// Helper lanes don't have state
Expand All @@ -3170,12 +3210,8 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
case DXOp::Ibfe:
case DXOp::Ubfe:
case DXOp::Bfi:
case DXOp::SampleIndex:
case DXOp::Coverage:
case DXOp::InnerCoverage:
case DXOp::MakeDouble:
case DXOp::SplitDouble:
case DXOp::PrimitiveID:
case DXOp::BitcastI16toF16:
case DXOp::BitcastF16toI16:
case DXOp::BitcastI32toF32:
Expand All @@ -3186,7 +3222,6 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
case DXOp::LegacyDoubleToSInt32:
case DXOp::LegacyDoubleToUInt32:
case DXOp::AttributeAtVertex:
case DXOp::ViewID:
case DXOp::InstanceID:
case DXOp::InstanceIndex:
case DXOp::PrimitiveIndex:
Expand Down
5 changes: 0 additions & 5 deletions renderdoc/driver/shaders/dxil/dxil_reflect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1829,9 +1829,6 @@ rdcstr Program::GetDebugStatus()
case DXOp::EvalSnapped:
case DXOp::EvalSampleIndex:
case DXOp::EvalCentroid:
case DXOp::SampleIndex:
case DXOp::Coverage:
case DXOp::InnerCoverage:
case DXOp::EmitStream:
case DXOp::CutStream:
case DXOp::EmitThenCutStream:
Expand All @@ -1843,7 +1840,6 @@ rdcstr Program::GetDebugStatus()
case DXOp::DomainLocation:
case DXOp::StorePatchConstant:
case DXOp::OutputControlPointID:
case DXOp::PrimitiveID:
case DXOp::CycleCounterLegacy:
case DXOp::WaveIsFirstLane:
case DXOp::WaveGetLaneIndex:
Expand Down Expand Up @@ -1871,7 +1867,6 @@ rdcstr Program::GetDebugStatus()
case DXOp::WaveAllBitCount:
case DXOp::WavePrefixBitCount:
case DXOp::AttributeAtVertex:
case DXOp::ViewID:
case DXOp::InstanceID:
case DXOp::InstanceIndex:
case DXOp::HitKind:
Expand Down

0 comments on commit 8de9c1d

Please sign in to comment.