From 449f80b74feade4a88d0503c3784cd551ccb0bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 16 Aug 2020 10:15:17 +0200 Subject: [PATCH] Address feedback. --- Common/Vulkan/VulkanMemory.cpp | 12 ++++++------ Common/Vulkan/VulkanMemory.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Common/Vulkan/VulkanMemory.cpp b/Common/Vulkan/VulkanMemory.cpp index ab5660b389..6698c73e2a 100644 --- a/Common/Vulkan/VulkanMemory.cpp +++ b/Common/Vulkan/VulkanMemory.cpp @@ -278,7 +278,7 @@ bool VulkanDeviceAllocator::AllocateFromSlab(Slab &slab, size_t &start, size_t b // Remember the size so we can free. slab.allocSizes[start] = blocks; - slab.tags[start] = { tag, (float)time_now_d(), 0.0f }; + slab.tags[start] = { tag, time_now_d(), 0.0 }; slab.totalUsage += blocks; return true; } @@ -436,15 +436,15 @@ bool VulkanDeviceAllocator::AllocateSlab(VkDeviceSize minBytes, int memoryTypeIn } void VulkanDeviceAllocator::ReportOldUsage() { - float now = time_now_d(); - static const float OLD_AGE = 10.0f; + double now = time_now_d(); + static const double OLD_AGE = 10.0; for (size_t i = 0; i < slabs_.size(); ++i) { const auto &slab = slabs_[i]; bool hasOldAllocs = false; for (auto it : slab.tags) { const auto info = it.second; - float touchedAge = now - info.touched; + double touchedAge = now - info.touched; if (touchedAge >= OLD_AGE) { hasOldAllocs = true; break; @@ -456,8 +456,8 @@ void VulkanDeviceAllocator::ReportOldUsage() { for (auto it : slab.tags) { const auto info = it.second; - float createAge = now - info.created; - float touchedAge = now - info.touched; + double createAge = now - info.created; + double touchedAge = now - info.touched; NOTICE_LOG(G3D, " * %s (created %fs ago, used %fs ago)", info.tag.c_str(), createAge, touchedAge); } } diff --git a/Common/Vulkan/VulkanMemory.h b/Common/Vulkan/VulkanMemory.h index 5c4cec8b1e..ba16245007 100644 --- a/Common/Vulkan/VulkanMemory.h +++ b/Common/Vulkan/VulkanMemory.h @@ -176,8 +176,8 @@ private: struct UsageInfo { std::string tag; - float created; - float touched; + double created; + double touched; }; struct Slab {