From d88026a697f389f91db4d8385f0f8c88666238cc Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 2 Apr 2020 15:41:17 +0300 Subject: [PATCH] Fix KHR storage counter issue for time units Renderdoc seems to somewhat require time units to be in float to be able to present prettyfied results (ms/us/ns). We were assuming that but a couple of errors slipped in : * we were asserting that KHR time units are floats * we didn't describe the renderdoc units as double (even though we forced the conversion later on) --- renderdoc/driver/vulkan/vk_counters.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_counters.cpp b/renderdoc/driver/vulkan/vk_counters.cpp index 52823131c..319416693 100644 --- a/renderdoc/driver/vulkan/vk_counters.cpp +++ b/renderdoc/driver/vulkan/vk_counters.cpp @@ -99,8 +99,6 @@ void VulkanReplay::convertKhrCounterResult(CounterResult &rdcResult, // Special case for time units, renderdoc only has a Seconds type. if(khrUnit == VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR) { - RDCASSERT(type == CompType::Double); - if((khrStorage == VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR) || (khrStorage == VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR)) { @@ -204,6 +202,10 @@ CounterDescription VulkanReplay::DescribeCounter(GPUCounter counterID) GetKHRUnitDescription(khrCounter.unit, khrCounter.storage, rdcDesc.unit, rdcDesc.resultType, rdcDesc.resultByteWidth); + // Special chase for time units. + if(khrCounter.unit == VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR) + rdcDesc.resultType = CompType::Double; + return rdcDesc; }