From 7c8d03b3e163771a19f81af22f73bd9e9e31e5ae Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 18 Jul 2019 18:05:01 +0100 Subject: [PATCH] [dxvk] Add helper to get size of memory/image in bytes --- src/dxvk/dxvk_image.h | 9 +++++++++ src/dxvk/dxvk_memory.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/dxvk/dxvk_image.h b/src/dxvk/dxvk_image.h index ac7cf8109..543c311ae 100644 --- a/src/dxvk/dxvk_image.h +++ b/src/dxvk/dxvk_image.h @@ -263,6 +263,15 @@ namespace dxvk { result |= m_viewFormats[i] == format; return result; } + + /** + * \brief Memory size + * + * \returns The memory size of the image + */ + VkDeviceSize memSize() const { + return m_memory.length(); + } private: diff --git a/src/dxvk/dxvk_memory.h b/src/dxvk/dxvk_memory.h index 7a905fa8c..bb2a8aacd 100644 --- a/src/dxvk/dxvk_memory.h +++ b/src/dxvk/dxvk_memory.h @@ -122,6 +122,15 @@ namespace dxvk { return reinterpret_cast(m_mapPtr) + offset; } + /** + * \brief Returns length of memory allocated + * + * \returns Memory size + */ + VkDeviceSize length() const { + return m_length; + } + /** * \brief Checks whether the memory slice is defined *