diff --git a/src/common/rendering/vulkan/system/vk_framebuffer.cpp b/src/common/rendering/vulkan/system/vk_framebuffer.cpp index 8e94c382a..02f7aa252 100644 --- a/src/common/rendering/vulkan/system/vk_framebuffer.cpp +++ b/src/common/rendering/vulkan/system/vk_framebuffer.cpp @@ -69,10 +69,17 @@ EXTERN_CVAR(Bool, cl_capfps) CCMD(vk_memstats) { - VmaStats stats = {}; - vmaCalculateStats(GetVulkanFrameBuffer()->device->allocator, &stats); - Printf("Allocated objects: %d, used bytes: %d MB\n", (int)stats.total.allocationCount, (int)stats.total.usedBytes / (1024 * 1024)); - Printf("Unused range count: %d, unused bytes: %d MB\n", (int)stats.total.unusedRangeCount, (int)stats.total.unusedBytes / (1024 * 1024)); + if (screen->IsVulkan()) + { + VmaStats stats = {}; + vmaCalculateStats(static_cast(screen)->device->allocator, &stats); + Printf("Allocated objects: %d, used bytes: %d MB\n", (int)stats.total.allocationCount, (int)stats.total.usedBytes / (1024 * 1024)); + Printf("Unused range count: %d, unused bytes: %d MB\n", (int)stats.total.unusedRangeCount, (int)stats.total.unusedBytes / (1024 * 1024)); + } + else + { + Printf("Vulkan is not the current render device\n"); + } } VulkanFrameBuffer::VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevice *dev) : diff --git a/src/common/rendering/vulkan/system/vk_framebuffer.h b/src/common/rendering/vulkan/system/vk_framebuffer.h index 40ed75633..e203a08c9 100644 --- a/src/common/rendering/vulkan/system/vk_framebuffer.h +++ b/src/common/rendering/vulkan/system/vk_framebuffer.h @@ -110,5 +110,3 @@ private: bool mVSync = false; }; - -inline VulkanFrameBuffer *GetVulkanFrameBuffer() { return static_cast(screen); }