summaryrefslogtreecommitdiffstats
path: root/src/tests/video_core
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-12-12 23:15:52 +0100
committerLiam <byteslice@airmail.cc>2023-12-15 03:54:36 +0100
commit030e6b3980aa5ce6069041c339d49d21d68ca73b (patch)
tree428a3d3a1e322a4cfad696bdcd756dd7332acefa /src/tests/video_core
parentMerge pull request #12354 from liamwhite/mackage-panager (diff)
downloadyuzu-030e6b3980aa5ce6069041c339d49d21d68ca73b.tar
yuzu-030e6b3980aa5ce6069041c339d49d21d68ca73b.tar.gz
yuzu-030e6b3980aa5ce6069041c339d49d21d68ca73b.tar.bz2
yuzu-030e6b3980aa5ce6069041c339d49d21d68ca73b.tar.lz
yuzu-030e6b3980aa5ce6069041c339d49d21d68ca73b.tar.xz
yuzu-030e6b3980aa5ce6069041c339d49d21d68ca73b.tar.zst
yuzu-030e6b3980aa5ce6069041c339d49d21d68ca73b.zip
Diffstat (limited to 'src/tests/video_core')
-rw-r--r--src/tests/video_core/memory_tracker.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/video_core/memory_tracker.cpp b/src/tests/video_core/memory_tracker.cpp
index 618793668..2dbff21af 100644
--- a/src/tests/video_core/memory_tracker.cpp
+++ b/src/tests/video_core/memory_tracker.cpp
@@ -23,13 +23,13 @@ constexpr VAddr c = 16 * HIGH_PAGE_SIZE;
class RasterizerInterface {
public:
- void UpdatePagesCachedCount(VAddr addr, u64 size, int delta) {
+ void UpdatePagesCachedCount(VAddr addr, u64 size, bool cache) {
const u64 page_start{addr >> Core::Memory::YUZU_PAGEBITS};
const u64 page_end{(addr + size + Core::Memory::YUZU_PAGESIZE - 1) >>
Core::Memory::YUZU_PAGEBITS};
for (u64 page = page_start; page < page_end; ++page) {
int& value = page_table[page];
- value += delta;
+ value += (cache ? 1 : -1);
if (value < 0) {
throw std::logic_error{"negative page"};
}
@@ -546,4 +546,4 @@ TEST_CASE("MemoryTracker: Cached write downloads") {
REQUIRE(!memory_track->IsRegionGpuModified(c + PAGE, PAGE));
memory_track->MarkRegionAsCpuModified(c, WORD);
REQUIRE(rasterizer.Count() == 0);
-} \ No newline at end of file
+}