Skip to content

Commit b26c0f2

Browse files
committed
Emit error message instead of crashing for missing SSA variables
Make GetLiveVariable() behave similarly to GetPhiVariable()
1 parent 8e733a7 commit b26c0f2

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

renderdoc/driver/shaders/dxil/dxil_debug.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5672,13 +5672,20 @@ bool ThreadState::IsVariableAssigned(const Id id) const
56725672

56735673
bool ThreadState::GetLiveVariable(const Id &id, Operation op, DXOp dxOpCode, ShaderVariable &var) const
56745674
{
5675-
RDCASSERT(id < m_Live.size());
5676-
RDCASSERT(m_Live[id]);
5675+
if(id < m_Live.size())
5676+
{
5677+
RDCASSERT(m_Live[id]);
5678+
RDCERR("Unknown Live Variable Id %d", id);
5679+
}
56775680
RDCASSERT(IsVariableAssigned(id));
56785681
auto it = m_Variables.find(id);
5679-
RDCASSERT(it != m_Variables.end());
5680-
var = it->second;
5681-
return GetVariableHelper(op, dxOpCode, var);
5682+
if(it != m_Variables.end())
5683+
{
5684+
var = it->second;
5685+
return GetVariableHelper(op, dxOpCode, var);
5686+
}
5687+
RDCERR("Unknown Variable %d", id);
5688+
return false;
56825689
}
56835690

56845691
bool ThreadState::GetPhiVariable(const Id &id, Operation op, DXOp dxOpCode, ShaderVariable &var) const

0 commit comments

Comments
 (0)