diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-26 09:16:27 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-26 09:16:27 -0500 |
| commit | f5f67b4a9daae13d5a8a68358c1167e6866ec293 (patch) | |
| tree | e9462d71f8ceabc75ff562e9c728df8a614637cf /runtime/shims/xmem.cpp | |
| parent | f5113e3da53f278873b473f1db7b1b08dbc8ceb6 (diff) | |
| parent | d088ea79b8394c04a46ec19efb2922a7cd3faae3 (diff) | |
Merge #2240 from zmasi: sync TitleTexture readability against title_memory_map between passes (RT-TITLE-TEXTURE-MAP-GEN)
Head d088ea79b.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/shims/xmem.cpp')
| -rw-r--r-- | runtime/shims/xmem.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/shims/xmem.cpp b/runtime/shims/xmem.cpp index f3863e2c9..a81adc0a8 100644 --- a/runtime/shims/xmem.cpp +++ b/runtime/shims/xmem.cpp | |||
| @@ -1626,7 +1626,7 @@ LONG CALLBACK physical_page_fault(EXCEPTION_POINTERS* info) { | |||
| 1626 | MEMORY_BASIC_INFORMATION seen{}; // the page as the decision saw it | 1626 | MEMORY_BASIC_INFORMATION seen{}; // the page as the decision saw it |
| 1627 | char read_note[1024]; | 1627 | char read_note[1024]; |
| 1628 | DWORD read_note_size = 0; | 1628 | DWORD read_note_size = 0; |
| 1629 | bool plant_read = false, promote = false; | 1629 | bool plant_read = false, promote = false, from_title = false; |
| 1630 | bool queried = false; | 1630 | bool queried = false; |
| 1631 | { | 1631 | { |
| 1632 | const FaultLockShared lock; | 1632 | const FaultLockShared lock; |
| @@ -1645,7 +1645,8 @@ LONG CALLBACK physical_page_fault(EXCEPTION_POINTERS* info) { | |||
| 1645 | if (where != kNoReservation || access == 1) | 1645 | if (where != kNoReservation || access == 1) |
| 1646 | queried = VirtualQuery(reinterpret_cast<const void*>(accessed), &seen, sizeof(seen)) != 0; | 1646 | queried = VirtualQuery(reinterpret_cast<const void*>(accessed), &seen, sizeof(seen)) != 0; |
| 1647 | const auto pc = reinterpret_cast<uintptr_t>(record->ExceptionAddress); | 1647 | const auto pc = reinterpret_cast<uintptr_t>(record->ExceptionAddress); |
| 1648 | if (access == 0 && result == PageCommit::not_ours && title_code(pc)) { | 1648 | from_title = access == 0 && result == PageCommit::not_ours && title_code(pc); |
| 1649 | if (from_title) { | ||
| 1649 | if (!queried) queried = VirtualQuery(reinterpret_cast<const void*>(accessed), &seen, sizeof(seen)) != 0; | 1650 | if (!queried) queried = VirtualQuery(reinterpret_cast<const void*>(accessed), &seen, sizeof(seen)) != 0; |
| 1650 | read_note_size = describe_read(read_note, pc, accessed, seen); | 1651 | read_note_size = describe_read(read_note, pc, accessed, seen); |
| 1651 | plant_read = where == kInWindow && g_pool_zero_pages; | 1652 | plant_read = where == kInWindow && g_pool_zero_pages; |
| @@ -1721,7 +1722,8 @@ LONG CALLBACK physical_page_fault(EXCEPTION_POINTERS* info) { | |||
| 1721 | exit = FaultExit::committed; | 1722 | exit = FaultExit::committed; |
| 1722 | } else if (answered) { | 1723 | } else if (answered) { |
| 1723 | exit = FaultExit::answered; | 1724 | exit = FaultExit::answered; |
| 1724 | } else if (result == PageCommit::committed_before && !escalated) { | 1725 | } else if ((result == PageCommit::committed_before && !escalated) || |
| 1726 | (title_page && access == 0 && result == PageCommit::not_ours && !from_title)) { | ||
| 1725 | exit = FaultExit::passed_guarded; // a guard's (the D3D12 layer's), routine: not noted | 1727 | exit = FaultExit::passed_guarded; // a guard's (the D3D12 layer's), routine: not noted |
| 1726 | } else if (title_page || reserved_write) { | 1728 | } else if (title_page || reserved_write) { |
| 1727 | note_fault(kRefused, accessed, access, result, where, seen); | 1729 | note_fault(kRefused, accessed, access, result, where, seen); |