diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-20 14:46:19 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-20 14:46:19 +0100 |
commit | da2fe8190518d3266df7f4a48f9b651eaea84d4b (patch) | |
tree | d584caaa250a596a3cbd3cd9d7e3767c13f46663 /src/video_core/renderer_vulkan | |
parent | TextureCache: Assure full conversions on depth/stencil write shaders. (diff) | |
download | yuzu-da2fe8190518d3266df7f4a48f9b651eaea84d4b.tar yuzu-da2fe8190518d3266df7f4a48f9b651eaea84d4b.tar.gz yuzu-da2fe8190518d3266df7f4a48f9b651eaea84d4b.tar.bz2 yuzu-da2fe8190518d3266df7f4a48f9b651eaea84d4b.tar.lz yuzu-da2fe8190518d3266df7f4a48f9b651eaea84d4b.tar.xz yuzu-da2fe8190518d3266df7f4a48f9b651eaea84d4b.tar.zst yuzu-da2fe8190518d3266df7f4a48f9b651eaea84d4b.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 7 |
1 files changed, 2 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 02215cfc2..f194110e5 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -8,6 +8,7 @@ #include <vector> #include "common/bit_cast.h" +#include "common/bit_util.h" #include "common/settings.h" #include "video_core/engines/fermi_2d.h" @@ -775,16 +776,12 @@ bool TextureCacheRuntime::ShouldReinterpret(Image& dst, Image& src) { return false; } -[[nodiscard]] size_t NextPow2(size_t value) { - return static_cast<size_t>(1ULL << ((8U * sizeof(size_t)) - std::countl_zero(value - 1U))); -} - VkBuffer TextureCacheRuntime::GetTemporaryBuffer(size_t needed_size) { const auto level = (8 * sizeof(size_t)) - std::countl_zero(needed_size - 1ULL); if (buffer_commits[level]) { return *buffers[level]; } - const auto new_size = NextPow2(needed_size); + const auto new_size = Common::NextPow2(needed_size); 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; |