diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2021-02-13 22:08:50 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-03-13 18:16:03 +0100 |
commit | 2f30c105849c214345e2201f4bd6f9b4b76ab4a1 (patch) | |
tree | 5e5889a44af4194fcf22d1375bdf9f91b5302dc1 /src/video_core/renderer_vulkan/vk_texture_cache.h | |
parent | astc_decoder: Fix out of bounds memory access (diff) | |
download | yuzu-2f30c105849c214345e2201f4bd6f9b4b76ab4a1.tar yuzu-2f30c105849c214345e2201f4bd6f9b4b76ab4a1.tar.gz yuzu-2f30c105849c214345e2201f4bd6f9b4b76ab4a1.tar.bz2 yuzu-2f30c105849c214345e2201f4bd6f9b4b76ab4a1.tar.lz yuzu-2f30c105849c214345e2201f4bd6f9b4b76ab4a1.tar.xz yuzu-2f30c105849c214345e2201f4bd6f9b4b76ab4a1.tar.zst yuzu-2f30c105849c214345e2201f4bd6f9b4b76ab4a1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 51705eccb..628785d5e 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -121,12 +121,17 @@ public: return *buffer; } - [[nodiscard]] VkImageCreateFlags AspectMask() const noexcept { + [[nodiscard]] VkImageAspectFlags AspectMask() const noexcept { return aspect_mask; } - [[nodiscard]] VkImageView StorageImageView() const noexcept { - return *storage_image_view; + [[nodiscard]] VkImageView StorageImageView(s32 level) const noexcept { + return *storage_image_views[level]; + } + + /// Returns true when the image is already initialized and mark it as initialized + [[nodiscard]] bool ExchangeInitialization() noexcept { + return std::exchange(initialized, true); } private: @@ -135,7 +140,7 @@ private: vk::Buffer buffer; MemoryCommit commit; vk::ImageView image_view; - vk::ImageView storage_image_view; + std::vector<vk::ImageView> storage_image_views; VkImageAspectFlags aspect_mask = 0; bool initialized = false; }; |