diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-01-04 01:05:59 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-01-15 20:19:40 +0100 |
commit | 432f045dbaa9476b31530478d812067c9291f309 (patch) | |
tree | b1bb0fd3e0cc8d23893062ed98fe1f3229046787 /src/video_core/renderer_vulkan | |
parent | vulkan_memory_allocator: Add allocation support for download types (diff) | |
download | yuzu-432f045dbaa9476b31530478d812067c9291f309.tar yuzu-432f045dbaa9476b31530478d812067c9291f309.tar.gz yuzu-432f045dbaa9476b31530478d812067c9291f309.tar.bz2 yuzu-432f045dbaa9476b31530478d812067c9291f309.tar.lz yuzu-432f045dbaa9476b31530478d812067c9291f309.tar.xz yuzu-432f045dbaa9476b31530478d812067c9291f309.tar.zst yuzu-432f045dbaa9476b31530478d812067c9291f309.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 10 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.h | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index a55f84045..ab14922d7 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -555,7 +555,15 @@ void TextureCacheRuntime::Finish() { ImageBufferMap TextureCacheRuntime::MapUploadBuffer(size_t size) { const auto staging_ref = staging_buffer_pool.Request(size, MemoryUsage::Upload); - return ImageBufferMap{ + return { + .handle = staging_ref.buffer, + .span = staging_ref.mapped_span, + }; +} + +ImageBufferMap TextureCacheRuntime::MapDownloadBuffer(size_t size) { + const auto staging_ref = staging_buffer_pool.Request(size, MemoryUsage::Download); + return { .handle = staging_ref.buffer, .span = staging_ref.mapped_span, }; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 5da791a56..a55d405d1 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h @@ -78,10 +78,7 @@ struct TextureCacheRuntime { [[nodiscard]] ImageBufferMap MapUploadBuffer(size_t size); - [[nodiscard]] ImageBufferMap MapDownloadBuffer(size_t size) { - // TODO: Have a special function for this - return MapUploadBuffer(size); - } + [[nodiscard]] ImageBufferMap MapDownloadBuffer(size_t size); void BlitImage(Framebuffer* dst_framebuffer, ImageView& dst, ImageView& src, const std::array<Offset2D, 2>& dst_region, |