mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
Core/Memory: Only FlushAndInvalidate GPU if the page is marked as RasterizerCachedMemory
This commit avoids Invalidating and Flushing the GPU if the page is not marked as a RasterizerCache Page.
This commit is contained in:
parent
b31880dc5e
commit
50259d7bdc
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue