diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.cpp b/rpcs3/Emu/RSX/VK/VKTextureCache.cpp index e913fdf439..9393b99a2b 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.cpp +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.cpp @@ -467,9 +467,9 @@ namespace vk return result; } - std::unique_ptr texture_cache::find_cached_image(VkFormat format, u16 w, u16 h, u16 d, u8 mipmaps, VkFlags flags) + std::unique_ptr texture_cache::find_cached_image(VkFormat format, u16 w, u16 h, u16 d, u16 mipmaps, VkFlags flags) { - auto hash_properties = [](VkFormat format, u16 w, u16 h, u16 d, u8 mipmaps, VkFlags flags) + auto hash_properties = [](VkFormat format, u16 w, u16 h, u16 d, u16 mipmaps, VkFlags flags) { ensure(static_cast(format) < 0xFF); return (static_cast(format) & 0xFF) | @@ -1286,7 +1286,7 @@ namespace vk vk::change_image_layout(cmd, image.get(), VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); auto result = image.get(); - const u32 resource_memory = image->memory->size(); + const auto resource_memory = image->memory->size(); auto disposable = std::unique_ptr(new cached_image_reference_t(this, image)); vk::get_resource_manager()->dispose(disposable); @@ -1316,8 +1316,9 @@ namespace vk return baseclass::get_unreleased_textures_count() + ::size32(m_cached_images); } - u32 texture_cache::get_temporary_memory_in_use() const + u64 texture_cache::get_temporary_memory_in_use() const { + // TODO: Technically incorrect, we should have separate metrics for cached evictable resources (this value) and temporary active resources. return m_cached_memory_size; } diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index 63f0f83e1c..215a22538a 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -385,7 +385,7 @@ namespace vk //Stuff that has been dereferenced goes into these const u32 max_cached_image_pool_size = 256; std::deque> m_cached_images; - atomic_t m_cached_memory_size = { 0 }; + atomic_t m_cached_memory_size = { 0 }; shared_mutex m_cached_pool_lock; void clear(); @@ -396,7 +396,7 @@ namespace vk vk::image* get_template_from_collection_impl(const std::vector& sections_to_transfer) const; - std::unique_ptr find_cached_image(VkFormat format, u16 w, u16 h, u16 d, u8 mipmaps, VkFlags flags); + std::unique_ptr find_cached_image(VkFormat format, u16 w, u16 h, u16 d, u16 mipmaps, VkFlags flags); std::unique_ptr find_cached_cubemap(VkFormat format, u16 size); @@ -463,7 +463,7 @@ namespace vk bool handle_memory_pressure(rsx::problem_severity severity) override; - u32 get_temporary_memory_in_use() const; + u64 get_temporary_memory_in_use() const; bool is_overallocated() const; };