mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-23 09:31:20 -08:00
video_core: lock interval map update
This commit is contained in:
parent
030e6b3980
commit
2a3f84aaf2
@ -29,6 +29,8 @@ RasterizerAccelerated::RasterizerAccelerated(Memory& cpu_memory_) : map{}, cpu_m
|
|||||||
RasterizerAccelerated::~RasterizerAccelerated() = default;
|
RasterizerAccelerated::~RasterizerAccelerated() = default;
|
||||||
|
|
||||||
void RasterizerAccelerated::UpdatePagesCachedCount(VAddr addr, u64 size, bool cache) {
|
void RasterizerAccelerated::UpdatePagesCachedCount(VAddr addr, u64 size, bool cache) {
|
||||||
|
std::scoped_lock lk{map_lock};
|
||||||
|
|
||||||
// Align sizes.
|
// Align sizes.
|
||||||
addr = Common::AlignDown(addr, YUZU_PAGESIZE);
|
addr = Common::AlignDown(addr, YUZU_PAGESIZE);
|
||||||
size = Common::AlignUp(size, YUZU_PAGESIZE);
|
size = Common::AlignUp(size, YUZU_PAGESIZE);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
#include <boost/icl/interval_map.hpp>
|
#include <boost/icl/interval_map.hpp>
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
@ -30,6 +31,7 @@ private:
|
|||||||
using IntervalType = IntervalMap::interval_type;
|
using IntervalType = IntervalMap::interval_type;
|
||||||
|
|
||||||
IntervalMap map;
|
IntervalMap map;
|
||||||
|
std::mutex map_lock;
|
||||||
Core::Memory::Memory& cpu_memory;
|
Core::Memory::Memory& cpu_memory;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user