upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 19:56:42 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 19:56:42 -0500
commit7e3bfb4e33e7276c32af515e601bc41c5424df54 (patch)
treea7ad8f733943d5f52ed7a5324f90a0ef887e4a1d /runtime
parent1d28e6e361c5c7e66ad6ea5ff59df483ff9d5c94 (diff)
PresentX: docs and a test state the one-slot-per-layout rule of the merge
The merged queue proxy recognises PresentX at slot 30 on a queue in the older layout and at slot 32 on a queue detected as the newer one (a fence at slot 16 or 17, or SignalX at 25), which is #984's measured behaviour, with main's LEONIDA_XS_PRESENT_X_SLOT pinning one slot and an attached handler answering first. Only one of the two is PresentX at a time: in the newer layout slot 30 is another method. docs/d3d12_vulkan.md still had main's row (the queue slots stay refused, gta6rt creates no presentation) and runtime/README.md still said PresentX has an unknown slot. Both describe the merged code now. check_presentation_wiring gains the newer-layout case: before the fence 30 reaches the presenter and 32 does not, after it 32 does and 30 does not. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/README.md9
-rw-r--r--runtime/test/xs_proxy_mock_test.cpp24
2 files changed, 28 insertions, 5 deletions
diff --git a/runtime/README.md b/runtime/README.md
index 8ef207133..eb4d934b1 100644
--- a/runtime/README.md
+++ b/runtime/README.md
@@ -498,10 +498,11 @@ blocks the import-driven work:
498 measured-slot proxy, but its parameter and flag layout is unmeasured, and the Xbox device vtable is only partly 498 measured-slot proxy, but its parameter and flag layout is unmeasured, and the Xbox device vtable is only partly
499 measured: the FSR DLL's calls confirm device slots 14, 15, 16, 18, 19, 27, 38, 62 and 76, slot 67 is a 499 measured: the FSR DLL's calls confirm device slots 14, 15, 16, 18, 19, 27, 38, 62 and 76, slot 67 is a
500 console-only pipeline call, and the rest is open (`docs/d3d12_vulkan.md`, question 2). 500 console-only pipeline call, and the rest is open (`docs/d3d12_vulkan.md`, question 2).
501- The command-queue and fence extensions: the proxies forward the public slots, and the console's own methods past 501- The command-queue and fence extensions: the proxies forward the public slots. Of the console's own queue methods
502 them (`PresentX`, `SuspendX`, `ResumeX`) have unknown slots, so they are refused with a log. 502 past them, `PresentX` is routed (slot 30, or 32 on a queue detected as the newer layout; `docs/d3d12_vulkan.md`)
503 `PresentX` and the frame events themselves are implemented (`shims/xbox_present.*`, `xbox_present_test`) but 503 to the presentation the device proxy builds on the first call (`shims/xbox_present.*`, `xbox_present_test`);
504 nothing reaches them yet: their queue and device slots are unmeasured. 504 `SuspendX` and `ResumeX` have unmeasured slots and are routed only when their variables name one. The other slots
505 past the PC table answer `S_OK` and do nothing.
505- Most of the `xgameruntime` surface: an offline shim covers `XGameRuntimeInitialize`, device/console queries, 506- Most of the `xgameruntime` surface: an offline shim covers `XGameRuntimeInitialize`, device/console queries,
506 `XTaskQueue` and `XAsync`, and `QueryApiImpl` serves `XThreadingImpl`, `XErrorImpl`, `XNetworkingImpl`, 507 `XTaskQueue` and `XAsync`, and `QueryApiImpl` serves `XThreadingImpl`, `XErrorImpl`, `XNetworkingImpl`,
507 `XPersistentLocalStorageImpl` and `XSystemImpl` (see `xgameruntime_test`); any other class is refused with a log. 508 `XPersistentLocalStorageImpl` and `XSystemImpl` (see `xgameruntime_test`); any other class is refused with a log.
diff --git a/runtime/test/xs_proxy_mock_test.cpp b/runtime/test/xs_proxy_mock_test.cpp
index 875881604..30e687344 100644
--- a/runtime/test/xs_proxy_mock_test.cpp
+++ b/runtime/test/xs_proxy_mock_test.cpp
@@ -3675,7 +3675,29 @@ int check_presentation_wiring() {
3675 3675
3676 EXPECT(release(queue) == 0); 3676 EXPECT(release(queue) == 0);
3677 EXPECT(release(device) == 0 && mock->refs == 0); 3677 EXPECT(release(device) == 0 && mock->refs == 0);
3678 std::printf("%s: presentation handler wiring (slots 78-81 and queue PresentX 30) passed\n", g_label); 3678
3679 // PresentX is one slot per layout, never both. A queue is in the older layout (PresentX at 30) until a fence
3680 // reaches slot 16 or 17, which only the newer layout's Signal and Wait take; from then on PresentX is two slots
3681 // later, at 32, and slot 30 is another console method there: S_OK, and the presenter is not called.
3682 Mock* newer_mock = nullptr;
3683 void* newer_device = make_device(newer_mock, 11, true);
3684 void* newer_queue = make_queue(newer_device);
3685 void* newer_fence = make_fence(newer_device);
3686 EXPECT(newer_device && newer_queue && newer_fence);
3687 MockPresenter np;
3688 xs::PresentationHandler nh = h;
3689 nh.context = &np;
3690 EXPECT(xs::set_presentation_handler(newer_device, &nh));
3691 EXPECT(hr_of(raw(newer_queue, 30, 1, 0x1000, 0x2000)) == S_OK && np.present_calls == 1);
3692 EXPECT(hr_of(raw(newer_queue, 32, 1, 0x1000, 0x2000)) == S_OK && np.present_calls == 1);
3693 EXPECT(hr_of(raw(newer_queue, 16, word(newer_fence), 1)) == S_OK);
3694 EXPECT(hr_of(raw(newer_queue, 32, 2, 0x1000, 0x2000)) == S_OK && np.present_calls == 2 && np.last_planes == 2);
3695 EXPECT(hr_of(raw(newer_queue, 30, 1, 0x1000, 0x2000)) == S_OK && np.present_calls == 2);
3696 EXPECT(xs::set_presentation_handler(newer_device, nullptr));
3697 EXPECT(release(newer_queue) == 0 && release(newer_fence) == 0);
3698 EXPECT(release(newer_device) == 0 && newer_mock->refs == 0);
3699 std::printf("%s: presentation handler wiring (slots 78-81 and queue PresentX 30, or 32 in the newer layout) "
3700 "passed\n", g_label);
3679 return 0; 3701 return 0;
3680} 3702}
3681 3703