vk: Silence compiler warnings

This commit is contained in:
kd-11 2022-02-05 21:53:34 +03:00 committed by kd-11
parent dca3d477c9
commit 51f9310b9f
2 changed files with 8 additions and 7 deletions

View File

@ -467,9 +467,9 @@ namespace vk
return result;
}
std::unique_ptr<vk::viewable_image> texture_cache::find_cached_image(VkFormat format, u16 w, u16 h, u16 d, u8 mipmaps, VkFlags flags)
std::unique_ptr<vk::viewable_image> 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<u32>(format) < 0xFF);
return (static_cast<u64>(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<vk::disposable_t>(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;
}

View File

@ -385,7 +385,7 @@ namespace vk
//Stuff that has been dereferenced goes into these
const u32 max_cached_image_pool_size = 256;
std::deque<std::unique_ptr<vk::viewable_image>> m_cached_images;
atomic_t<u32> m_cached_memory_size = { 0 };
atomic_t<u64> 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<copy_region_descriptor>& sections_to_transfer) const;
std::unique_ptr<vk::viewable_image> find_cached_image(VkFormat format, u16 w, u16 h, u16 d, u8 mipmaps, VkFlags flags);
std::unique_ptr<vk::viewable_image> find_cached_image(VkFormat format, u16 w, u16 h, u16 d, u16 mipmaps, VkFlags flags);
std::unique_ptr<vk::viewable_image> 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;
};