mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Convert counters that are in kb or ms into normalised units
This commit is contained in:
@@ -429,6 +429,13 @@ uint32_t AMDCounters::GetSampleUint32(uint32_t session, uint32_t sample, GPUCoun
|
||||
|
||||
m_pGPUPerfAPI->getSampleUInt32(session, sample, internalIndex, &value);
|
||||
|
||||
// normalise units as expected
|
||||
GPA_Usage_Type usageType;
|
||||
m_pGPUPerfAPI->getCounterUsageType(internalIndex, &usageType);
|
||||
|
||||
if(usageType == GPA_USAGE_TYPE_KILOBYTES)
|
||||
value *= 1000;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -439,6 +446,13 @@ uint64_t AMDCounters::GetSampleUint64(uint32_t session, uint32_t sample, GPUCoun
|
||||
|
||||
m_pGPUPerfAPI->getSampleUInt64(session, sample, internalIndex, &value);
|
||||
|
||||
// normalise units as expected
|
||||
GPA_Usage_Type usageType;
|
||||
m_pGPUPerfAPI->getCounterUsageType(internalIndex, &usageType);
|
||||
|
||||
if(usageType == GPA_USAGE_TYPE_KILOBYTES)
|
||||
value *= 1000;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -449,6 +463,15 @@ float AMDCounters::GetSampleFloat32(uint32_t session, uint32_t sample, GPUCounte
|
||||
|
||||
m_pGPUPerfAPI->getSampleFloat32(session, sample, internalIndex, &value);
|
||||
|
||||
// normalise units as expected
|
||||
GPA_Usage_Type usageType;
|
||||
m_pGPUPerfAPI->getCounterUsageType(internalIndex, &usageType);
|
||||
|
||||
if(usageType == GPA_USAGE_TYPE_KILOBYTES)
|
||||
value *= 1000.0f;
|
||||
else if(usageType == GPA_USAGE_TYPE_MILLISECONDS)
|
||||
value /= 1000.0f;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -459,5 +482,14 @@ double AMDCounters::GetSampleFloat64(uint32_t session, uint32_t sample, GPUCount
|
||||
|
||||
m_pGPUPerfAPI->getSampleFloat64(session, sample, internalIndex, &value);
|
||||
|
||||
// normalise units as expected
|
||||
GPA_Usage_Type usageType;
|
||||
m_pGPUPerfAPI->getCounterUsageType(internalIndex, &usageType);
|
||||
|
||||
if(usageType == GPA_USAGE_TYPE_KILOBYTES)
|
||||
value *= 1000.0;
|
||||
else if(usageType == GPA_USAGE_TYPE_MILLISECONDS)
|
||||
value /= 1000.0;
|
||||
|
||||
return value;
|
||||
}
|
||||
Reference in New Issue
Block a user