From 00f10fec7d5cb96bc980a6d272dc8d33597a1b20 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Mon, 8 Feb 2016 21:20:20 -0800 Subject: [PATCH] vkinfo: Fix bytes -> megabytes conversion Also only report 256 MiB (chosen arbitrarily) as the null driver's memory heap size. The previous value wasn't reasonable on 64-bit systems (2^63 + 1). Change-Id: Id57a4895752af45d046072ae8fee386ca219e82d --- vulkan/nulldrv/null_driver.cpp | 2 +- vulkan/tools/vkinfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vulkan/nulldrv/null_driver.cpp b/vulkan/nulldrv/null_driver.cpp index 8f47bd11a5..9462a3e6fb 100644 --- a/vulkan/nulldrv/null_driver.cpp +++ b/vulkan/nulldrv/null_driver.cpp @@ -89,7 +89,7 @@ enum Enum { }; } // namespace HandleType -const VkDeviceSize kMaxDeviceMemory = VkDeviceSize(INTPTR_MAX) + 1; +const VkDeviceSize kMaxDeviceMemory = 0x10000000; // 256 MiB, arbitrary } // anonymous namespace diff --git a/vulkan/tools/vkinfo.cpp b/vulkan/tools/vkinfo.cpp index 462a8e5ca0..9cbd23466c 100644 --- a/vulkan/tools/vkinfo.cpp +++ b/vulkan/tools/vkinfo.cpp @@ -342,7 +342,7 @@ void PrintGpuInfo(const GpuInfo& info, const Options& options, size_t indent) { strbuf << "DEVICE_LOCAL"; printf("%sHeap %u: %" PRIu64 " MiB (0x%" PRIx64 " B) %s\n", Indent(indent + 1), heap, - info.memory.memoryHeaps[heap].size / 0x1000000, + info.memory.memoryHeaps[heap].size / 0x100000, info.memory.memoryHeaps[heap].size, strbuf.str().c_str()); strbuf.str(std::string()); -- 2.11.0