diff options
author | GPUCode <geoster3d@gmail.com> | 2023-05-27 16:09:17 +0200 |
---|---|---|
committer | GPUCode <geoster3d@gmail.com> | 2023-06-18 11:45:18 +0200 |
commit | 7b2f680468bbac206f96b26a1300939be90f5f1b (patch) | |
tree | c8f506462c6d2b577ab0273e50c530fd7c71abbc /src/video_core/renderer_vulkan/vk_texture_cache.cpp | |
parent | renderer_vulkan: Use VMA for images (diff) | |
download | yuzu-7b2f680468bbac206f96b26a1300939be90f5f1b.tar yuzu-7b2f680468bbac206f96b26a1300939be90f5f1b.tar.gz yuzu-7b2f680468bbac206f96b26a1300939be90f5f1b.tar.bz2 yuzu-7b2f680468bbac206f96b26a1300939be90f5f1b.tar.lz yuzu-7b2f680468bbac206f96b26a1300939be90f5f1b.tar.xz yuzu-7b2f680468bbac206f96b26a1300939be90f5f1b.tar.zst yuzu-7b2f680468bbac206f96b26a1300939be90f5f1b.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_texture_cache.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 9 |
1 files changed, 4 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 10defe6cb..28985b6fe 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -839,14 +839,14 @@ bool TextureCacheRuntime::ShouldReinterpret(Image& dst, Image& src) { VkBuffer TextureCacheRuntime::GetTemporaryBuffer(size_t needed_size) { const auto level = (8 * sizeof(size_t)) - std::countl_zero(needed_size - 1ULL); - if (buffer_commits[level]) { + if (buffers[level]) { return *buffers[level]; } const auto new_size = Common::NextPow2(needed_size); static constexpr VkBufferUsageFlags flags = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; - buffers[level] = device.GetLogical().CreateBuffer({ + const VkBufferCreateInfo temp_ci = { .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, .pNext = nullptr, .flags = 0, @@ -855,9 +855,8 @@ VkBuffer TextureCacheRuntime::GetTemporaryBuffer(size_t needed_size) { .sharingMode = VK_SHARING_MODE_EXCLUSIVE, .queueFamilyIndexCount = 0, .pQueueFamilyIndices = nullptr, - }); - buffer_commits[level] = std::make_unique<MemoryCommit>( - memory_allocator.Commit(buffers[level], MemoryUsage::DeviceLocal)); + }; + buffers[level] = memory_allocator.CreateBuffer(temp_ci, MemoryUsage::DeviceLocal); return *buffers[level]; } |