Convert GPU Time counter correctly

This commit is contained in:
Tayfun Kayhan
2020-02-29 12:28:19 +01:00
committed by baldurk
parent 3a9152a318
commit 2373ae7b45
+10 -1
View File
@@ -134,7 +134,16 @@ void VulkanReplay::convertKhrCounterResult(CounterResult &rdcResult,
if(khrUnit == VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR)
{
RDCASSERT(type == CompType::Double);
rdcResult.value.d /= 1000.0 * 1000.0 * 1000.0;
if((khrStorage == VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR) ||
(khrStorage == VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR))
{
rdcResult.value.d = rdcResult.value.d / (1000.0 * 1000.0 * 1000.0);
}
else
{
rdcResult.value.d = (double)(rdcResult.value.u64) / (1000.0 * 1000.0 * 1000.0);
}
}
}