diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-25 04:09:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-25 04:09:12 +0200 |
commit | b9c2732121e2594a64d1141807c7d5bd0f317d0f (patch) | |
tree | 700ab748e15d1e7d5cf7f58f2cbac133b7a84915 /src/video_core/renderer_vulkan | |
parent | Merge pull request #6522 from Morph1984/pragma (diff) | |
parent | common: Replace common_sizes into user-literals (diff) | |
download | yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.gz yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.bz2 yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.lz yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.xz yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.zst yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp | 8 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_stream_buffer.cpp | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index 7a1232497..0412b5234 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -12,6 +12,7 @@ #include "common/assert.h" #include "common/bit_util.h" #include "common/common_types.h" +#include "common/literals.h" #include "video_core/renderer_vulkan/vk_scheduler.h" #include "video_core/renderer_vulkan/vk_staging_buffer_pool.h" #include "video_core/vulkan_common/vulkan_device.h" @@ -19,12 +20,15 @@ namespace Vulkan { namespace { + +using namespace Common::Literals; + // Maximum potential alignment of a Vulkan buffer constexpr VkDeviceSize MAX_ALIGNMENT = 256; // Maximum size to put elements in the stream buffer -constexpr VkDeviceSize MAX_STREAM_BUFFER_REQUEST_SIZE = 8 * 1024 * 1024; +constexpr VkDeviceSize MAX_STREAM_BUFFER_REQUEST_SIZE = 8_MiB; // Stream buffer size in bytes -constexpr VkDeviceSize STREAM_BUFFER_SIZE = 128 * 1024 * 1024; +constexpr VkDeviceSize STREAM_BUFFER_SIZE = 128_MiB; constexpr VkDeviceSize REGION_SIZE = STREAM_BUFFER_SIZE / StagingBufferPool::NUM_SYNCS; constexpr VkMemoryPropertyFlags HOST_FLAGS = diff --git a/src/video_core/renderer_vulkan/vk_stream_buffer.cpp b/src/video_core/renderer_vulkan/vk_stream_buffer.cpp index a09fe084e..7b4875d0e 100644 --- a/src/video_core/renderer_vulkan/vk_stream_buffer.cpp +++ b/src/video_core/renderer_vulkan/vk_stream_buffer.cpp @@ -10,6 +10,7 @@ #include "common/alignment.h" #include "common/assert.h" +#include "common/literals.h" #include "video_core/renderer_vulkan/vk_scheduler.h" #include "video_core/renderer_vulkan/vk_stream_buffer.h" #include "video_core/vulkan_common/vulkan_device.h" @@ -19,6 +20,8 @@ namespace Vulkan { namespace { +using namespace Common::Literals; + constexpr VkBufferUsageFlags BUFFER_USAGE = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; @@ -26,7 +29,7 @@ constexpr VkBufferUsageFlags BUFFER_USAGE = constexpr u64 WATCHES_INITIAL_RESERVE = 0x4000; constexpr u64 WATCHES_RESERVE_CHUNK = 0x1000; -constexpr u64 PREFERRED_STREAM_BUFFER_SIZE = 256 * 1024 * 1024; +constexpr u64 PREFERRED_STREAM_BUFFER_SIZE = 256_MiB; /// Find a memory type with the passed requirements std::optional<u32> FindMemoryType(const VkPhysicalDeviceMemoryProperties& properties, |