video_core: Use binary memory-literals for memory-sizes (#7127)

Replaces `... * 1024 * 1024` with `_MiB`/`_GiB` literals.
This commit is contained in:
Wunk
2023-11-06 13:38:54 -08:00
committed by GitHub
parent 5193a5d222
commit 8fe147b8f9
4 changed files with 20 additions and 11 deletions

View File

@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "common/alignment.h"
#include "common/literals.h"
#include "common/logging/log.h"
#include "common/math_util.h"
#include "common/microprofile.h"
@@ -28,11 +29,12 @@ MICROPROFILE_DEFINE(Vulkan_Drawing, "Vulkan", "Drawing", MP_RGB(128, 128, 192));
using TriangleTopology = Pica::PipelineRegs::TriangleTopology;
using VideoCore::SurfaceType;
using namespace Common::Literals;
using namespace Pica::Shader::Generator;
constexpr u64 STREAM_BUFFER_SIZE = 64 * 1024 * 1024;
constexpr u64 UNIFORM_BUFFER_SIZE = 4 * 1024 * 1024;
constexpr u64 TEXTURE_BUFFER_SIZE = 2 * 1024 * 1024;
constexpr u64 STREAM_BUFFER_SIZE = 64_MiB;
constexpr u64 UNIFORM_BUFFER_SIZE = 4_MiB;
constexpr u64 TEXTURE_BUFFER_SIZE = 2_MiB;
constexpr vk::BufferUsageFlags BUFFER_USAGE =
vk::BufferUsageFlagBits::eVertexBuffer | vk::BufferUsageFlagBits::eIndexBuffer;

View File

@@ -4,6 +4,7 @@
#include <boost/container/small_vector.hpp>
#include "common/literals.h"
#include "common/microprofile.h"
#include "common/scope_exit.h"
#include "video_core/custom_textures/material.h"
@@ -35,6 +36,7 @@ using VideoCore::MapType;
using VideoCore::PixelFormat;
using VideoCore::SurfaceType;
using VideoCore::TextureType;
using namespace Common::Literals;
struct RecordParams {
vk::ImageAspectFlags aspect;
@@ -244,8 +246,8 @@ vk::ImageSubresourceRange MakeSubresourceRange(vk::ImageAspectFlags aspect, u32
};
}
constexpr u64 UPLOAD_BUFFER_SIZE = 512 * 1024 * 1024;
constexpr u64 DOWNLOAD_BUFFER_SIZE = 16 * 1024 * 1024;
constexpr u64 UPLOAD_BUFFER_SIZE = 512_MiB;
constexpr u64 DOWNLOAD_BUFFER_SIZE = 16_MiB;
} // Anonymous namespace