mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 15:34:36 +00:00
Fix for assert in GetGpuSourceLocationZonesCntReal
When TRACY_NO_STATISTICS is defined, the assert in GetGpuSourceLocationZonesCntReal will always get hit as nothing is ever inserted in gpuSourceLocationZonesCnt unless reading from a file. Match the behavior with GetGpuSourceLocationZonesReal to add the source location if it is missing.
This commit is contained in:
parent
15145aa74c
commit
0c7cbd1d03
@ -3425,7 +3425,10 @@ uint64_t* Worker::GetSourceLocationZonesCntReal( uint16_t srcloc )
|
||||
uint64_t* Worker::GetGpuSourceLocationZonesCntReal( uint16_t srcloc )
|
||||
{
|
||||
auto it = m_data.gpuSourceLocationZonesCnt.find( srcloc );
|
||||
assert( it != m_data.gpuSourceLocationZonesCnt.end() );
|
||||
if( it == m_data.gpuSourceLocationZonesCnt.end() )
|
||||
{
|
||||
it = m_data.gpuSourceLocationZonesCnt.emplace( srcloc, 0 ).first;
|
||||
}
|
||||
m_data.gpuCntLast.first = srcloc;
|
||||
m_data.gpuCntLast.second = &it->second;
|
||||
return &it->second;
|
||||
|
Loading…
Reference in New Issue
Block a user