Don't track first pointer writes when we have debug info

This commit is contained in:
baldurk
2022-07-22 16:10:59 +01:00
parent a967805a24
commit e6100167aa
@@ -262,7 +262,11 @@ void ThreadState::WritePointerValue(Id pointer, const ShaderVariable &val)
// plus any additional ones for other pointers.
Id ptrid = debugger.GetPointerBaseId(var);
bool firstLocalWrite = ReferencePointer(ptrid);
// only track local writes when we don't have debug info, so we can track variables first
// becoming alive
bool firstLocalWrite = false;
if(!debugger.HasDebugInfo())
firstLocalWrite = ReferencePointer(ptrid);
ShaderVariableChange basechange;
@@ -314,9 +318,9 @@ void ThreadState::WritePointerValue(Id pointer, const ShaderVariable &val)
// This one is not included in any of the pointers lists above
basechange.after = debugger.GetPointerValue(ids[ptrid]);
// if this is the first local write when we have no debug info, mark this variable as becoming
// alive here, instead of at its declaration
if(firstLocalWrite && !debugger.HasDebugInfo())
// if this is the first local write, mark this variable as becoming alive here, instead of at
// its declaration
if(firstLocalWrite)
basechange.before.name = "";
m_State->changes.push_back(basechange);