1
0
Fork 0
forked from suyu/suyu

Merge pull request #2872 from FernandoS27/mem-gpu-opt

Core/Memory: Only FlushAndInvalidate GPU if the page is marked as RasterizerCachedMemory
This commit is contained in:
David 2019-09-21 20:07:25 +10:00 committed by GitHub
commit c7c8ffbc13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,8 +43,13 @@ static void MapPages(Common::PageTable& page_table, VAddr base, u64 size, u8* me
// During boot, current_page_table might not be set yet, in which case we need not flush // During boot, current_page_table might not be set yet, in which case we need not flush
if (Core::System::GetInstance().IsPoweredOn()) { if (Core::System::GetInstance().IsPoweredOn()) {
Core::System::GetInstance().GPU().FlushAndInvalidateRegion(base << PAGE_BITS, auto& gpu = Core::System::GetInstance().GPU();
size * PAGE_SIZE); for (u64 i = 0; i < size; i++) {
const auto page = base + i;
if (page_table.attributes[page] == Common::PageType::RasterizerCachedMemory) {
gpu.FlushAndInvalidateRegion(page << PAGE_BITS, PAGE_SIZE);
}
}
} }
VAddr end = base + size; VAddr end = base + size;