wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
8.64k stars 595 forks source link

Memory allocations call stacks: Logic for active and inactive allocations is swapped #743

Closed citron0xa9 closed 3 months ago

citron0xa9 commented 3 months ago

Only inactive allocations are displayed when using the "Only active allocations" checkbox. Similarly, only active allocations are displayed when using the "Only inactive allocation" toggle.

I think the logic in TracyView_FrameTree.cpp lines 73 and 113 needs to be changed i.e. from

if( ( memRange == MemRange::Inactive ) == ( ev.TimeFree() >= 0 && ev.TimeFree() < m_memInfo.range.max ) ) continue;
...
if( ( memRange == MemRange::Inactive ) == ( ev.TimeFree() >= 0 ) ) continue;

to

if( ( memRange == MemRange::Inactive ) != ( ev.TimeFree() >= 0 && ev.TimeFree() < m_memInfo.range.max ) ) continue;
...
if( ( memRange == MemRange::Inactive ) != ( ev.TimeFree() >= 0 ) ) continue;
citron0xa9 commented 3 months ago

Sorry I did not see that this was already resolved.