diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 05:31:36 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 05:31:36 -0500 |
| commit | eedc7c8db98f26a0cf23d3593bb2eb39fe47d491 (patch) | |
| tree | a3336405d51973cf96961c9c2462d4e45ba69ab5 /runtime | |
| parent | 682a557f873acad42a3df33133a02ab3b3ded600 (diff) | |
d3d12_xs: queue slot 31 without a mapper keeps the unmodelled answer
xs_proxy_mock failed at line 4791: on a queue whose presentation is
managed outside (set_presentation_handler), raw(queue, 31, 0) must be
E_NOTIMPL and must not reach SuspendX. #1723's CopyPageMappingsBatchX
dispatch answered every slot-31 call itself, and with no hook and no
xmem (a proxy compiled alone) queue_copy_page_mappings returned S_OK
having mapped nothing.
The test was right. The file's own comment says that without xmem the
slot is refused as before, and check_queue_copy_page_mappings expects
the console-only answer every unmodelled queue slot gets in that case.
The new dispatch now runs only when something can remap (a hook set
with set_copy_page_mappings_hook, or xmem's copy_page_mappings_fn);
otherwise the call goes on to the presentation routes and the
unmodelled-slot answer as on main. With xmem linked, as in gta6rt,
nothing changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/shims/d3d12_xs_device.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/runtime/shims/d3d12_xs_device.cpp b/runtime/shims/d3d12_xs_device.cpp index 55113b8c3..57f209c19 100644 --- a/runtime/shims/d3d12_xs_device.cpp +++ b/runtime/shims/d3d12_xs_device.cpp | |||
| @@ -2258,16 +2258,22 @@ std::uint64_t WINAPI child_slot(ChildProxy* self, std::uint64_t a1, std::uint64_ | |||
| 2258 | std::unique_lock<std::mutex> queue_order; | 2258 | std::unique_lock<std::mutex> queue_order; |
| 2259 | if constexpr (K == ChildKind::queue && queue_slot_orders_work(Slot)) | 2259 | if constexpr (K == ChildKind::queue && queue_slot_orders_work(Slot)) |
| 2260 | queue_order = std::unique_lock(self->queue_order); | 2260 | queue_order = std::unique_lock(self->queue_order); |
| 2261 | // CopyPageMappingsBatchX when something can remap: a hook (set_copy_page_mappings_hook) or xmem. Without | ||
| 2262 | // either (a proxy compiled without xmem) the slot keeps the answer every unmodelled queue slot past the | ||
| 2263 | // public chain gets below: console-only S_OK, or E_NOTIMPL on a queue whose presentation is managed outside. | ||
| 2261 | if constexpr (K == ChildKind::queue && Slot == kQueueCopyPageMappingsBatchX) { | 2264 | if constexpr (K == ChildKind::queue && Slot == kQueueCopyPageMappingsBatchX) { |
| 2262 | const HRESULT hr = queue_copy_page_mappings(self, UINT(a1), reinterpret_cast<const xmem::PageBatch*>(a2), | 2265 | if (g_copy_page_mappings.load(std::memory_order_acquire) || rt::xmem::copy_page_mappings_fn) { |
| 2263 | a3, UINT(a4), UINT(a5)); | 2266 | const HRESULT hr = queue_copy_page_mappings( |
| 2264 | if (FAILED(hr)) { | 2267 | self, UINT(a1), reinterpret_cast<const xmem::PageBatch*>(a2), a3, UINT(a4), UINT(a5)); |
| 2265 | static std::atomic<unsigned> failures{0}; | 2268 | if (FAILED(hr)) { |
| 2266 | if (failures.fetch_add(1, std::memory_order_relaxed) < 8) | 2269 | static std::atomic<unsigned> failures{0}; |
| 2267 | std::fprintf(stderr, "[rt] CopyPageMappingsBatchX failed: hr=0x%08x batches=%u pool=%p pages=%u flags=%u\n", | 2270 | if (failures.fetch_add(1, std::memory_order_relaxed) < 8) |
| 2268 | unsigned(hr), UINT(a1), reinterpret_cast<void*>(a3), UINT(a4), UINT(a5)); | 2271 | std::fprintf(stderr, "[rt] CopyPageMappingsBatchX failed: hr=0x%08x batches=%u pool=%p " |
| 2272 | "pages=%u flags=%u\n", unsigned(hr), UINT(a1), reinterpret_cast<void*>(a3), | ||
| 2273 | UINT(a4), UINT(a5)); | ||
| 2274 | } | ||
| 2275 | return hr_to_u64(d3d12_trace::result(child_trace_name<K>(Slot), hr)); | ||
| 2269 | } | 2276 | } |
| 2270 | return hr_to_u64(d3d12_trace::result(child_trace_name<K>(Slot), hr)); | ||
| 2271 | } | 2277 | } |
| 2272 | if constexpr (K == ChildKind::queue && Slot == kQueueExecuteCommandListsX) { | 2278 | if constexpr (K == ChildKind::queue && Slot == kQueueExecuteCommandListsX) { |
| 2273 | d3d12_trace::record(child_trace_name<K>(Slot)); | 2279 | d3d12_trace::record(child_trace_name<K>(Slot)); |