mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-12 08:18:58 -05:00
Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU
This commit is contained in:
@ -96,7 +96,7 @@ struct GPU::Impl {
|
||||
/// Synchronizes CPU writes with Host GPU memory.
|
||||
void InvalidateGPUCache() {
|
||||
std::function<void(VAddr, size_t)> callback_writes(
|
||||
[this](VAddr address, size_t size) { rasterizer->OnCPUWrite(address, size); });
|
||||
[this](VAddr address, size_t size) { rasterizer->OnCacheInvalidation(address, size); });
|
||||
system.GatherGPUDirtyMemory(callback_writes);
|
||||
}
|
||||
|
||||
@ -301,6 +301,10 @@ struct GPU::Impl {
|
||||
gpu_thread.InvalidateRegion(addr, size);
|
||||
}
|
||||
|
||||
bool OnCPUWrite(VAddr addr, u64 size) {
|
||||
return rasterizer->OnCPUWrite(addr, size);
|
||||
}
|
||||
|
||||
/// Notify rasterizer that any caches of the specified region should be flushed and invalidated
|
||||
void FlushAndInvalidateRegion(VAddr addr, u64 size) {
|
||||
gpu_thread.FlushAndInvalidateRegion(addr, size);
|
||||
@ -563,6 +567,10 @@ void GPU::InvalidateRegion(VAddr addr, u64 size) {
|
||||
impl->InvalidateRegion(addr, size);
|
||||
}
|
||||
|
||||
bool GPU::OnCPUWrite(VAddr addr, u64 size) {
|
||||
return impl->OnCPUWrite(addr, size);
|
||||
}
|
||||
|
||||
void GPU::FlushAndInvalidateRegion(VAddr addr, u64 size) {
|
||||
impl->FlushAndInvalidateRegion(addr, size);
|
||||
}
|
||||
|
Reference in New Issue
Block a user