summaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache
diff options
context:
space:
mode:
authorGravatar bunnei2021-06-24 19:09:12 -0700
committerGravatar GitHub2021-06-24 19:09:12 -0700
commitb9c2732121e2594a64d1141807c7d5bd0f317d0f (patch)
tree700ab748e15d1e7d5cf7f58f2cbac133b7a84915 /src/video_core/buffer_cache
parentMerge pull request #6522 from Morph1984/pragma (diff)
parentcommon: Replace common_sizes into user-literals (diff)
downloadyuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.gz
yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.xz
yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.zip
Merge pull request #6519 from Wunkolo/mem-size-literal
common: Replace common_sizes into user-literals
Diffstat (limited to 'src/video_core/buffer_cache')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 6d04d00da..9d726a6fb 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -16,9 +16,9 @@
16 16
17#include <boost/container/small_vector.hpp> 17#include <boost/container/small_vector.hpp>
18 18
19#include "common/common_sizes.h"
20#include "common/common_types.h" 19#include "common/common_types.h"
21#include "common/div_ceil.h" 20#include "common/div_ceil.h"
21#include "common/literals.h"
22#include "common/microprofile.h" 22#include "common/microprofile.h"
23#include "common/scope_exit.h" 23#include "common/scope_exit.h"
24#include "common/settings.h" 24#include "common/settings.h"
@@ -48,8 +48,11 @@ constexpr u32 NUM_COMPUTE_UNIFORM_BUFFERS = 8;
48constexpr u32 NUM_STORAGE_BUFFERS = 16; 48constexpr u32 NUM_STORAGE_BUFFERS = 16;
49constexpr u32 NUM_STAGES = 5; 49constexpr u32 NUM_STAGES = 5;
50 50
51using namespace Common::Literals;
52
51template <typename P> 53template <typename P>
52class BufferCache { 54class BufferCache {
55
53 // Page size for caching purposes. 56 // Page size for caching purposes.
54 // This is unrelated to the CPU page size and it can be changed as it seems optimal. 57 // This is unrelated to the CPU page size and it can be changed as it seems optimal.
55 static constexpr u32 PAGE_BITS = 16; 58 static constexpr u32 PAGE_BITS = 16;
@@ -66,8 +69,8 @@ class BufferCache {
66 69
67 static constexpr BufferId NULL_BUFFER_ID{0}; 70 static constexpr BufferId NULL_BUFFER_ID{0};
68 71
69 static constexpr u64 EXPECTED_MEMORY = Common::Size_512_MB; 72 static constexpr u64 EXPECTED_MEMORY = 512_MiB;
70 static constexpr u64 CRITICAL_MEMORY = Common::Size_1_GB; 73 static constexpr u64 CRITICAL_MEMORY = 1_GiB;
71 74
72 using Maxwell = Tegra::Engines::Maxwell3D::Regs; 75 using Maxwell = Tegra::Engines::Maxwell3D::Regs;
73 76
@@ -96,7 +99,7 @@ class BufferCache {
96 }; 99 };
97 100
98public: 101public:
99 static constexpr u32 DEFAULT_SKIP_CACHE_SIZE = 4096; 102 static constexpr u32 DEFAULT_SKIP_CACHE_SIZE = 4_KiB;
100 103
101 explicit BufferCache(VideoCore::RasterizerInterface& rasterizer_, 104 explicit BufferCache(VideoCore::RasterizerInterface& rasterizer_,
102 Tegra::Engines::Maxwell3D& maxwell3d_, 105 Tegra::Engines::Maxwell3D& maxwell3d_,