Skip to content

xgameruntime: serve XAccessibilityImpl offline through QueryApiImpl - #4235

Open
evilclanker9000 wants to merge 3 commits into
ItsNotRexed:mainfrom
evilclanker9000:claude/rt-accessibility
Open

evilclanker9000 wants to merge 3 commits into
ItsNotRexed:mainfrom
evilclanker9000:claude/rt-accessibility

Conversation

@evilclanker9000

@evilclanker9000 evilclanker9000 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Item: RT-280

Requested by Lucas · project thread

Claimed in the coordination issue as: EGEN-RT-ACCESSIBILITY, #4084 (comment)

What and why

QueryApiImpl refused XAccessibilityImpl (class 3e241977-6237-41e9-8559-102c2d9983f1), so a title's first XClosedCaptionGetProperties, XHighContrastGetMode or XSpeechToText* call failed with ERROR_NOT_SUPPORTED. It now serves the class and IXAccessibilityImpl2 offline, in runtime/shims/xgameruntime_accessibility.cpp, hooked in with one line in QueryApiImpl. The 19 slots follow xgameruntime-docs' layout; signatures follow the public GDK reference. No package DLL calls any of them, so the slots are not measured against a caller (docs/runtime_imports.md says so).

A PC with no console accessibility settings answers like a console with everything off:

  • closed captions: off, scale 1, white font, until the title calls XClosedCaptionSetEnabled, which the next XClosedCaptionGetProperties reports;
  • high contrast: Off;
  • speech-to-text: accepted and dropped (the title's text is not logged); Begin hands out an id that Update/Finalize/Cancel check;
  • speech synthesizer: no voice installed, so the enumeration calls back zero times, handles can be created and closed, and anything that would produce audio fails with HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED).

XColor's byte layout is not in the pages read; only the font colour (all 0xFF, the same in any channel order) is filled in.

Touches runtime/shims/xgameruntime.cpp (6 lines) and the source lists in runtime/CMakeLists.txt and scripts/build_runtime.ps1. #3657 does the same for XGameUiImpl in its own file; the two should merge with a trivial conflict at the QueryApiImpl loop.

Tested

Windows 11, MSVC 2022 Build Tools, RelWithDebInfo. No GPU involved.

  • xgameruntime_accessibility_test (new, registered as ctest xgameruntime_accessibility): 45 checks, 0 failures. It calls every slot through QueryApiImpl the way the thunks do, and checks the ids against the text the docs print.
  • xgameruntime_test: OK (106 checks); gta6rt builds.
  • Negative control: changing *mode = kHighContrastOff to *mode = 1 makes XHighContrastGetMode reports Off (0) fail (45 checks, 1 failure); reverted.
  • tests/test_build_runtime_batch.py, test_build_runtime_fallback.py, test_ctest_registration.py, test_cmake_vulkan_missing.py: OK.

AI-assisted.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)

QueryApiImpl now serves XAccessibilityImpl (IXAccessibilityImpl and 2, 19
methods in xgameruntime-docs' order): closed captions report off until the
title sets them, high contrast is Off, speech-to-text calls are accepted and
dropped with hypothesis ids tracked, and the speech synthesizer has no
installed voice (handles work, stream creation is not supported).
xgameruntime_accessibility_test calls every slot.

AI-assisted.
@ray3242

ray3242 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Independent check of 07070dab on a second toolchain: clang-cl 21 cross-build (xwin, Windows SDK 10.0.26100, RelWithDebInfo), run under Wine 11 on Ubuntu 22.04. No GPU involved.

  • xgameruntime_accessibility_test: 45 checks, 0 failures, in 3 of 3 runs.
  • xgameruntime_test: OK (106 checks). gta6rt.exe links with the new file.
  • No new warnings under /W4 from the new file or test.
  • All three CMake source lists that compile shims/xgameruntime.cpp (gta6rt, xgameruntime_test and the new test) also add xgameruntime_accessibility.cpp, and so does the cl.exe fallback in build_runtime.ps1. So nothing links QueryApiImpl without the new hook.

AI-assisted (Devin).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built xgameruntime_accessibility_test at 07070dab on Windows 11 and ran it: 45 checks, 0 failures, exit 0; ctest -R xgameruntime_accessibility -> 1/1 passed (0.01 s).

The shim answers the XAccessibilityImpl QueryApiImpl surface offline: the speech synthesizer create/set-voice/close paths, the "not supported" stream-creation results that clear the handle, null-handle and double-close E_INVALIDARGs, and the closed-synthesizer case all match the checks. No blocking issue.

@sh1shu1

sh1shu1 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 07070da on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo: pass, no regression against main aa2988c.

  • ctest: 154/154 passed, same 9 skips as main aa2988c
  • xgameruntime_accessibility: 1/1
  • run_gpu_tests (LEONIDA_VK_VALIDATION=1): 164/210 native, 195/210 with LEONIDA_W64_EMULATE=1, 0 failed; identical to main aa2988c
    AI-assisted (Claude Code, Claude Fable 5.1).

Conflicts: docs/runtime_imports.md, runtime/CMakeLists.txt,
runtime/shims/xgameruntime.cpp, scripts/build_runtime.ps1

AI-assisted.
Conflicts: docs/runtime_imports.md

AI-assisted.
@Atomic258

Copy link
Copy Markdown
Contributor

Windows check of b6cba7e5 (merge head incl. current main) — pass.

Environment: Windows 11, MSVC 19.44 (RelWithDebInfo, Ninja), CPU only. Synthetic API test, no game files, no GPU.

  • xgameruntime_accessibility_test built clean and passed: 45 checks, 0 failures — covers closed-caption properties/set, high-contrast mode, and the speech synthesator handle lifecycle through QueryApiImpl.

Re-check on the merged head; the earlier Linux check was on an older revision.

AI-assisted (Devin).

@amarovndres

Copy link
Copy Markdown

Tested b6cba7e5 on Windows 11 Pro (build 26200), with the runtime's xgameruntime_test and xgameruntime_accessibility_test built from this head with MSVC (VS 2022 Build Tools, Windows SDK 10.0.26100): pass.

  • ctest -R xgameruntime: xgameruntime_accessibility passed (45 checks, 0 failures), and xgameruntime passed. The other xgameruntime_* entries were Not Run only because I built just the two targets this PR touches.

AI-assisted (Claude Code). No game files.

@DenRakEiw

Copy link
Copy Markdown
Contributor

Tested b6cba7e5 on Windows 11 (MSVC 19.44 / Ninja / Windows SDK 10.0.26100, no game files): pass.

  • Trial-merged onto origin/main (3faac557): clean; xgameruntime_accessibility_test built cleanly.
  • ctest -R xgameruntime_accessibility -V: 1/1 passed (45 checks, 0 failures, 0.05s).

AI-assisted (Gemini 4 Neon).

@tunczzz

tunczzz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested b6cba7e5 (merge base 3faac557) on Windows 11 10.0.26300 with an NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), driver 616.56. Result: pass.

  • Runtime built from this head: MSVC 19.44 (BuildTools 2022), Ninja, RelWithDebInfo, -DLEONIDA_VULKAN_HEADERS_FETCH=ON (no Vulkan SDK; the loader comes from the NVIDIA driver). glslangValidator and llvm-mc 21 came from WSL Ubuntu. Build exit 0.
  • ctest -j 3: 178/178 passed. New here: xgameruntime_accessibility PASS.
  • scripts/run_gpu_tests.py --build <this build>: 170/217 passed, 47 skipped, 0 failed.
  • Compared test by test with main 3faac557 on the same machine (ctest 177/177, GPU 170/217): every result is the same.

Not run: other GPUs/vendors, Linux, the Vulkan validation layer (not installed). No game files.

AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants