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)
This commit is contained in:
Lionel Landwerlin
2020-04-02 15:41:17 +03:00
committed by Baldur Karlsson
parent d2f7837ecf
commit d88026a697
+4 -2
View File
@@ -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;
}