mirror of
https://github.com/spoopyghosty0/frameport.git
synced 2026-10-07 00:00:41 +02:00
Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2d93af973 | ||
|
|
59fb47a827 | ||
|
|
9e169e069b | ||
|
|
eed6e4aaed | ||
|
|
9829ee1666 | ||
|
|
13069db28a | ||
|
|
7058105056 | ||
|
|
3929ff0a8b | ||
|
|
4910440f56 | ||
|
|
bda9045be6 | ||
|
|
a7890d46de | ||
|
|
50ab3eb341 | ||
|
|
4313b52792 | ||
|
|
4f9ecf4801 | ||
|
|
9a5efa28f5 | ||
|
|
cf900cd9d4 | ||
|
|
ef21b33ca2 | ||
|
|
799f1bd9f1 |
No files matched your search
@@ -520,10 +520,12 @@ Steam placeholder set (no Steam art at all) → fixed in artwork/steam.py.
|
||||
**Space warp / ITR2 (2026-10-04):** Into The Radius 2 (UE5, `libUnreal.so` + OVRPlugin, Vulkan) uses Application SpaceWarp (extra swapchains `376x376 format=97` motion vectors + `format=129` depth); #35 reports flickering textures. OVRPort's `patch_disable_space_warp` has no effect on UE5, and hiding XR_FB_space_warp in FrameBridge's enumerate doesn't reach the game either: **OVRPort's dispatcher offers/enables XR_FB_space_warp itself**. FrameBridge `hide_space_warp` (per game, off) hides it and strips `XrCompositionLayerSpaceWarpInfoFB` (1000171000) from the projection views (log `hide_space_warp: removed space warp info`); the game still renders its MV swapchains. Test build installed on the dev Frame; flicker not yet checked in a headset. Heuristic: UE5 + OVRPlugin shows it as an option (off). `equirect_emul` is suggested for Unreal games whose graphics API isn't detected ("GLES or unknown"); on Vulkan it switches itself off (Myst/Riven/ITR2): harmless, but Unreal Vulkan detection is a known gap.
|
||||
**PR #34 (merged 2026-10-04, Lucas-Mathieu):** `native/adapter/audio_metadata.h` patches Meta XR Audio Wwise (only build ID e1619e7f…, Batman: Arkham Shadow 1.4.1) so queued audio metadata isn't freed while the current audio frame references it (smoke-bomb crash). Verified headless: installs ("metadata reclamation follows …"), 72 fps; we added a once-per-second scan limit. Outside PRs: review source, rebuild `artifacts/` ourselves, merge locally (contributor's commit kept), push main.
|
||||
**Heuristics eval (2026-10-04):** `scripts/eval_heuristics.py "<VR CyberDeck Portable>"` → 19/44 recipes exact, 322/352 fields (most diffs: `frame.unity_text_input` suggested where older catalog recipes lack it; the rest are runtime-only findings: use_alt, vk_shader_fix, focus_hold, sync_guard, multipass). `PATCHED/` copies aren't scored (already converted).
|
||||
**Power (0.9, agent v47):** sidebar bar above the Frame card: Sleep / Restart / Shut down, each confirmed (`app.frame_power`, a running game asks again). logind answers CanSuspend/CanReboot/CanPowerOff = "challenge" for an SSH session but "yes" inside a user unit, so agent `power` runs `systemctl suspend|reboot|poweroff` from a transient `systemd-run --user --on-active=3` timer (the command answers first). Restart verified on the device (back in ~84 s, new boot id).
|
||||
**Power (0.9, agent v47):** sidebar bar below the Frame card: Sleep / Restart / Shut down, each confirmed (`app.frame_power`, a running game asks again). logind answers CanSuspend/CanReboot/CanPowerOff = "challenge" for an SSH session but "yes" inside a user unit, so agent `power` runs `systemctl suspend|reboot|poweroff` from a transient `systemd-run --user --on-active=3` timer (the command answers first). Restart verified on the device (back in ~84 s, new boot id).
|
||||
**Proton default (agent v51, owner's choice 2026-10-05):** the newest **stable** ARM64 Proton is the default for PC VR games (`pick_proton`: asked-for name/alias, else newest installed stable, else any stable). Agent v49-50 defaulted to Experimental; the owner's headset A/B with Rick and Morty (Experimental 69 % reprojected frames, stable felt much smoother) reverted it. The game page's Customize shows `pcvr.proton_tool` as a dropdown (Stable (default) / Experimental = alias `proton-experimental`); `ensure_proton` installs a chosen one (it asks once more for the runtime Steam only names after Proton is installed; Experimental installed unattended on the device in 53 s). A PC VR launch test that fails on stable suggests Experimental (`pipeline.PROTON_TOOL`, `proton_alternative_worth_trying`, button "Try Proton Experimental and reinstall"). Remaining Rick and Morty stutter on head turns = the game rendering below the refresh rate (reprojection), not Proton.
|
||||
**USB cable link (verified 2026-10-05, cabled to the dev PC):** `usb0` is a USB **NCM** gadget (configfs g1: `ncm.usb0` + `ffs.adb`, Valve 28de:2460) set up by `usb-ncm-gadget@usb0.service`, which only runs with `ConditionPathExists=|/etc/systemd/system/adbd.service.d/steamos-devkit-enabled` = **Developer Mode only**. `usb-ncm-dnsmasq@usb0` serves DHCP with fixed `dhcp-host` entries: Frame 10.86.200.233, PC **10.86.200.234** (`frame/usb.py` FRAME_USB_IP/PC_USB_IP). Windows 11 binds its built-in "UsbNcm Host Device" (no driver); WSL mirrored sees eth 10.86.200.234. USB is high-speed (USB 2.0): upload 36.9 MB/s vs 11.3 MB/s home Wi-Fi. Frame→PC over the cable worked without a firewall change. `scripts/usb_autotest.py` (Windows via powershell.exe from WSL), `frameport frame usb-check`. Wizard "Set up with a USB cable" (`PairingServer(host=PC_USB_IP)`; the real bootstrap ran end to end over USB). Discovery dedupes by SSH host key and prefers USB > Frame hotspot > network (`discovery.dedupe`); a lost address is re-found by key (`Frame.relocate`, tested with a dead saved address).
|
||||
**Catalog updates without a release (2026-10-05):** apps fetch `catalog/games/*.yaml` from GitHub `main` (`recommend/catalog.refresh_remote`: one API call `git/trees/main?recursive=1` + raw.githubusercontent downloads of changed blobs, cached as `catalog-gh-<sha>.yaml`, every 6 h; GUI at start + Settings → Data "Check now"; CLI background thread + `frameport catalog-update`). `catalog.load()` only reads the cache. A remote entry is skipped (`unusable_reason`) when it names a patch/adapter key this app doesn't register, has a field `CatalogEntry` doesn't know, or `min_app` > this version: add `min_app` (or rely on new patch ids) when a config needs an unreleased FramePort. Remote beats bundled unless the bundled entry has a later updated/verified date; the user's own entries still win as before. Off: setting `catalog.auto_update`, env FRAMEPORT_NO_CATALOG_UPDATE; FRAMEPORT_CATALOG_URL still overrides the source. So: **pushing a catalog change to main reaches users within 6 h** (their recipes follow via catalog_rev → Update on Frame).
|
||||
**Start activity / QuestCraft / ITR2 pop-in (2026-10-05):** WiiCompiled's VR part (`QuestActivity`, SDL, process `:game`) stays behind Lepton's flat window when the launcher is shown (`device.text_input_window`). `frame.start_activity` (opt-in; analysis `extra.vr_activity` = the original APK's activity with Meta's VR category when it isn't the launcher) gives that activity's filter LAUNCHER and every other LAUNCHER becomes INFO, per element (`axml.set_start_activity`); Lepton's own `apk-info-extractor --print-activity-name` (on the Frame under Lepton/liblepton/apk_extractor) then answers QuestActivity. **OVRPort gives every MAIN activity LAUNCHER + VR categories**, so the VR activity must come from the original APK's analysis, not the converted manifest. Lepton has no activity override (`APP_ACTIVITY` is reset when app_metadata.sh is sourced). QuestCraft reaches Minecraft 1.21.5 (Fabric, Vivecraft, Sodium; LTW "Large Thin Wrapper" GL 3.0 on the Frame's Zink) and stops at `OpenGL error 1282` in `WindowFramebuffer` createTexture (Minecraft's crash report in `files/instances/1.21.5/crash-reports/`, Pojlib's `files/latestlog.txt`); the vrclient SIGSEGV / "pthread_mutex_lock called on a destroyed mutex" afterwards is only the shutdown (Unity's render thread still in vrclient while the instance is destroyed). ITR2 "models popping in and out" in game: Unreal reads user config from **internal** storage (`lepton-data/internal/<pkg>/files/UnrealGame/<Project>/<Project>/Saved/Config/Android/Engine.ini`, not external); `r.AllowOcclusionQueries=0` there broke its menus (removed again). Vulkan shim `vk_query_slots` (two slots per occlusion query) never saw ITR2 create an occlusion query pool, and the run with it crashed (Unreal RenderThread SIGSEGV, caught by sentry-native: no tombstone; the backtrace is in `cache/sentry/*/.sentry-native/*.run/*.envelope` with module offsets) - left off. Next suspect: Unreal 5 mobile HZB occlusion reading depth stored with Valve's FDM injection layer; test = launcher `VK_INSTANCE_LAYERS=''` (Lepton then loads neither VALVE_rpo nor VALVE_fdm_injection, Fossilize still). QuestCraft: LTW overrides glGetError and returns 0 with `LIBGL_NOERROR` set; Lepton passes `LEPTON_ENV_<NAME>` to the app as `<NAME>`, so catalog `lepton_env: {LEPTON_ENV_LIBGL_NOERROR: '1'}` gets Minecraft past the GL error 1282; then black picture (see the catalog entry). FrameBridge logs `new layer` once per layer type per process and projection views only for the first frames, so a second session in the same process (Vivecraft after Unity) needs `layer_debug=1`.
|
||||
**Vulkan validation / ITR2 solved (2026-10-05):** Khronos' validation layer can't come from Lepton (its layer dir is in the read-only guest image; the Linux copies on the Frame are glibc) and a global `debug.vulkan.layers` property (via the LEPTON_GFXRECON_FP_PROPS trick) kills the container at boot. Working recipe: bundle `libVkLayer_khronos_validation.so` (Khronos android-binaries release, arm64-v8a, stored uncompressed) into a test APK re-signed with the game's key (`apk.sign.sign`), install with `frameport install <pkg> --apk`, and set the Vulkan shim's `vk_validation=1` (it adds the layer at vkCreateInstance; findings under the logcat tag VALIDATION in launch.log, each message ID capped at 10). ITR2's flicker + windows behind models = Unreal's Qualcomm shader-resolve subpasses with a depth resolve of a single-sampled depth attachment (VUID-04908/-03179); `vk_spec_fixes=1` drops that resolve (its TRANSFER_DST half never applies to ITR2: the main depth is transient). Valve's VALVE_rpo layer removed ITR2's fog (catalog `lepton_env: VK_INSTANCE_LAYERS: VK_LAYER_VALVE_fdm_injection`). `r.ViewDistanceScale=2` in the internal Saved/Config/Android/Engine.ini only exists on the owner's Frame (the catalog can't write internal storage yet). Launch tests: Lepton prints a transient "is not a running context" on the first start after an APK change (agent v54 `not_started` waits 30 s for "Boot complete!").
|
||||
**Lepton storage (2026-09-30):** each app's /sdcard (= /storage/emulated/0 → `<base>/lepton-data/external`) has `Movies`/`Download`/`Documents` symlinked to the Frame's `~/Videos`/`~/Downloads`/`~/Documents` (liblepton/mounting.sh, only if they exist at start); agent v24 `storage_targets` reads that mapping. Android's MediaProvider canonicalises paths to /home/steamos/... and rejects every file ("doesn't appear under [/system/media...]"), `sm list-volumes` is empty: the media index never works, apps must browse folders. Lepton installs with `adb install -g` (runtime permissions granted, MANAGE_EXTERNAL_STORAGE too). Files: `install/files.py`, `frameport frame send|storage`, GUI Files tab (formerly Frame → Send files).
|
||||
**SteamVR per-app settings (2026-09-30):** editing steamvr.vrsettings while SteamVR runs is lost; the web API (127.0.0.1:27062 /app/setsettings) needs `x-steamvr-secret`. `native/vrsettings` = `fp_vrsettings.exe` (freestanding, OpenVR `FnTable:IVRSettings_003` as a Utility app, loads SteamVR's bin/win64/openvr_api.dll) sets them live and SteamVR persists them: section `steam.app.<shortcut appid>`, keys `preferredRefreshRate` (float) and `motionSmoothingOverride` (0 global, 1 on, 2 off, 3 always). Steam Link (vrlink) lists the Frame's rates 72/80/90/96/108/120/144 in vrserver.txt and follows the per-app preference ("host preferred N Hz"; whether the key is honoured is unverified in-headset yet). Judder metric: vrcompositor.txt session summary dropped + "Timed out. N total" (Stormland: 0 dropped but 313 timeouts in 2 min); fpsVR (`%LOCALAPPDATA%\fpsVR\*.json`, 0.1 ms histograms) gives p99 CPU/GPU ms. `pcvr.steamvr_tuning` (default on, PC only) applies on Play: highest rate whose budget ≥ p99×1.05, at least one step down, smoothing on.
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import time
|
||||
import zlib
|
||||
from types import SimpleNamespace
|
||||
|
||||
AGENT_VERSION = 53
|
||||
AGENT_VERSION = 54
|
||||
HOME = os.path.expanduser("~")
|
||||
STEAM = os.path.join(HOME, ".local/share/Steam")
|
||||
ANCHORS = os.path.join(HOME, "Applications/quest-frame")
|
||||
@@ -3058,7 +3058,7 @@ def cmd_launch_test(args):
|
||||
if "Exited!" in text:
|
||||
state = "EXITED"
|
||||
break
|
||||
if "Early-exit" in text or "is not a running context" in text:
|
||||
if "Early-exit" in text or not_started(text, time.time() - start):
|
||||
state = "NEVER_STARTED"
|
||||
break
|
||||
elapsed = round(time.time() - start)
|
||||
@@ -3699,6 +3699,14 @@ def dashboard_worker(log, parent, wait_start=240, window=30, poll=0.5, ui_log=No
|
||||
time.sleep(poll)
|
||||
|
||||
|
||||
def not_started(text, waited, grace=30):
|
||||
"""Lepton's container didn't come up: "is not a running context" with no "Boot complete!" after it for `grace`
|
||||
seconds. The first start after an APK change prints that message while it waits for the boot and then boots
|
||||
normally (installing the new APK): agent 53 and older stopped those starts after a few seconds."""
|
||||
i = text.rfind("is not a running context")
|
||||
return i >= 0 and "Boot complete!" not in text[i:] and waited >= grace
|
||||
|
||||
|
||||
COMMANDS = {n[4:]: f for n, f in globals().items() if n.startswith("cmd_")}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
48a3ecad77ec0f3215b29070e994590eb9579e04d3c88a47f37f306f9aeb01d9 ./arm64-v8a/libfp_langpack.so
|
||||
a5b03bb7ae5d953d7ded2bf117b0a19c57fae604f16f54310847f8e89593dde6 ./arm64-v8a/libfp_ovrp.so
|
||||
6d2b9f8cea2f2cf33b8ff30d29a2f3d9c4d55549260a867168a24e44abada021 ./arm64-v8a/libfp_vk.so
|
||||
b5949e9e90e4c51e2733b9f6cd3c857a447552ac7291aec340407c27b034b600 ./arm64-v8a/libfp_vk.so
|
||||
383054f8b3b41dde76d062c71856cd3163655e50009c08454bc1793f393ead65 ./arm64-v8a/libfpg.so
|
||||
8e00552d1ab90f82749db3caad4f773351fa8a28edcc5ea5cbd1b31c434ff32a ./arm64-v8a/libframe_xrshim.so
|
||||
3dfcb0f2bec47857bcecc7261c58e076d872d4649718c40850f29e10c75477dd ./arm64-v8a/libglshim.so
|
||||
3e05bb8561c7fd8787b3120739b3ce66c68badb5b00571bd50ae7e6c1f159274 ./arm64-v8a/libopenxr_loader_generic.so
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +1,21 @@
|
||||
package: com.CMGames.IntoTheRadius2
|
||||
title: Into The Radius 2
|
||||
status: issues
|
||||
notes: Space warp is turned off (no flickering textures in the headset); the headset's brief focus losses are hidden
|
||||
(focus_hold, up to 2.5 s) because the game pauses on each. Loading a save can take over a minute.
|
||||
status: works
|
||||
notes: Plays well (owner-verified 2026-10-05). Space warp is off, the headset's brief focus losses are hidden
|
||||
(focus_hold, up to 2.5 s), only Valve's foveation layer is loaded (its render-pass optimizer removed the fog) and
|
||||
an invalid depth resolve in Unreal's render passes is dropped (vk_spec_fixes; it made models flicker and windows
|
||||
show behind them). Needs FramePort 0.9.2 or newer. Loading a save can take over a minute.
|
||||
details: Unreal Engine 5 game that uses Meta's Application SpaceWarp (extra motion-vector and depth swapchains). OVRPort's
|
||||
patch_disable_space_warp doesn't reach Unreal Engine 5, so FrameBridge's hide_space_warp hides XR_FB_space_warp and
|
||||
removes the space warp info from the eye images. Working config shared in GitHub issue 35. In the headset
|
||||
(2026-10-05) the Frame dropped focus for 0.4 s and 1.0 s within ten seconds and Unreal paused each time; loading a save
|
||||
shows no frames for 40-80 s while the game's Sentry SDK (debug mode) logs its breadcrumbs.
|
||||
shows no frames for 40-80 s while the game's Sentry SDK (debug mode) logs its breadcrumbs. Valve's VALVE_rpo
|
||||
(render-pass optimizer) Vulkan layer removes the game's fog (owner-verified 2026-10-05; with only VALVE_fdm_injection
|
||||
loaded the fog renders), which also hid the distance culling; ruled out for the remaining pop-in - Vulkan occlusion
|
||||
query slots, Valve's FDM layer. The cause, found with Khronos' validation layer (vk_validation) - Unreal's render
|
||||
passes use Qualcomm's shader resolve (VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM) together with a depth resolve
|
||||
of a single-sampled depth attachment (VUID-VkSubpassDescription2-flags-04908, -03179), harmless on Quest's driver,
|
||||
wrong depth on the Frame's Mesa; the Vulkan shim's vk_spec_fixes drops that resolve.
|
||||
tested_version: 1.2.4
|
||||
engine: Unreal
|
||||
xr: OpenXR
|
||||
@@ -18,8 +26,11 @@ adapter:
|
||||
hide_space_warp: 1
|
||||
focus_hold: 1
|
||||
focus_hold_ms: 2500
|
||||
vk_spec_fixes: 1
|
||||
lepton_env:
|
||||
VK_INSTANCE_LAYERS: VK_LAYER_VALVE_fdm_injection
|
||||
verified:
|
||||
date: '2026-10-04'
|
||||
date: '2026-10-05'
|
||||
issue: 35
|
||||
updated: '2026-10-05'
|
||||
min_app: 0.9.2
|
||||
source_hint: Into The Radius 2
|
||||
@@ -0,0 +1,17 @@
|
||||
package: com.camouflaj.salmon
|
||||
title: Marvel's Iron Man VR
|
||||
status: works
|
||||
tested_version: 0.1.0-250068
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
verified:
|
||||
date: '2026-10-05'
|
||||
known_good_sha256: 41e0ab90f622afd50accb0b6e2553520d30a6cc82e5ab4cbb2341b48f7316a71
|
||||
app: 0.9.1
|
||||
overport_cli: 1.2.5
|
||||
issue: 47
|
||||
source_hint: Marvel's Iron Man VR
|
||||
@@ -1,13 +1,18 @@
|
||||
package: com.qcxr.qcxr
|
||||
title: QuestCraft
|
||||
status: issues
|
||||
notes: The launcher runs, but Minecraft crashes while starting its graphics (OpenGL error 1282).
|
||||
status: works
|
||||
notes: Minecraft runs in VR (Vivecraft, about 72 fps; drops while worlds load). Needs FramePort 0.9.2 or newer for
|
||||
the picture (older versions show black). On first start QuestCraft downloads its Java runtime, which didn't unpack on
|
||||
the Frame once (see details).
|
||||
details: QuestCraft downloads its Java runtime (JRE.zip from QuestCraft's GitHub releases) into files/runtimes/JRE
|
||||
on first start; on the Frame that step left nothing behind ("libjvm.so not found"). With the runtime unpacked there
|
||||
by hand, Java, Fabric and the mods load and Minecraft 1.21.5 starts initializing, then its first texture fails with
|
||||
OpenGL error 1282 in QuestCraft's GL-to-GLES layer on Zink. Leads (2026-10-04) - Android's libEGL ran out of
|
||||
eglGetProcAddress slots for desktop GL functions; LWJGL and JNA natives in the APK don't match the newer files
|
||||
QuestCraft downloads.
|
||||
on first start; on the Frame that step once left nothing behind ("libjvm.so not found"; unpacked by hand). Two
|
||||
Frame fixes, both owner-verified 2026-10-05. (1) Minecraft 1.21.5 checks GL errors strictly and aborted with
|
||||
"OpenGL error 1282", an error the Frame's Mesa (Zink) reports where Quest's driver doesn't; QuestCraft's GL-to-GLES
|
||||
layer (LTW) ignores GL errors when LIBGL_NOERROR is set, which Lepton passes from LEPTON_ENV_LIBGL_NOERROR. (2) LTW
|
||||
passes desktop GL_DEPTH_COMPONENT32 through, which Mesa rejects, so every framebuffer was incomplete and the picture
|
||||
black; frame.ltw_depth (automatic for APKs with libltw.so) loads GLES through a shim that asks for
|
||||
GL_DEPTH_COMPONENT32F. Left over, harmless so far - Mesa still reports about 4 GL_INVALID_OPERATION per frame
|
||||
("in glthread", so the call is unknown; mesa_glthread=false would name it).
|
||||
tested_version: 6.0.0-RC4
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
@@ -15,7 +20,9 @@ frame:
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
lepton_env:
|
||||
LEPTON_ENV_LIBGL_NOERROR: '1'
|
||||
verified:
|
||||
date: '2026-10-04'
|
||||
updated: '2026-10-04'
|
||||
date: '2026-10-05'
|
||||
updated: '2026-10-05'
|
||||
source_hint: QuestCraft
|
||||
@@ -0,0 +1,20 @@
|
||||
package: com.resolutiongames.abvriop.santacruz
|
||||
title: palazzo_santacruz
|
||||
status: works
|
||||
notes: Played a few levels. Passthrough also works.
|
||||
tested_version: 3.7.6.10866-release
|
||||
engine: Unity
|
||||
xr: OpenXR
|
||||
frame:
|
||||
- frame.unity_text_input
|
||||
device:
|
||||
- device.text_input_window
|
||||
verified:
|
||||
date: '2026-10-05'
|
||||
known_good_sha256: 394214a68297c1e5b019dc4f65b145e7bd0e98604205616364e0c151c1afd894
|
||||
app: 0.9.1
|
||||
overport_cli: 1.2.5
|
||||
frame_build: '20260922.6101926'
|
||||
agent: 48
|
||||
issue: 46
|
||||
source_hint: abvriop
|
||||
@@ -3,13 +3,18 @@ title: WiiCompiled VR
|
||||
status: issues
|
||||
notes: 'To add a game: in FramePort''s Files tab, upload your .wcgame file to this game''s storage, folder
|
||||
Android/data/org.wiicompiled.quest/files/WiiCompiledOpenXRVR/Import, then open WiiCompiled (it imports the newest
|
||||
file there; one at a time). The right eye jitters during races.'
|
||||
file there; one at a time). Once your game is imported, turn on "Start straight in VR" (and off "Show the app''s
|
||||
Android window") and update it on the Frame: it then opens in VR without the flat launcher window, which otherwise
|
||||
stays in view (turn it off again to import another game). The right eye jitters during races.'
|
||||
details: A native Mario Kart Wii recompilation (needs your own disc as .wcgame files built by the WiiCompiled
|
||||
launcher on a computer). Lepton's Android has no document picker, so the launcher's "Import from computer" and
|
||||
"select disc image" buttons fail (ActivityNotFoundException for OPEN_DOCUMENT); its Import folder is read when the
|
||||
launcher opens instead. The game's libmain.so has its own OpenXR loader and talks to the Frame's runtime directly
|
||||
(FrameBridge isn't in its path); the right-eye jitter in races comes from its stereo replay of the race view, so it
|
||||
needs a fix in WiiCompiled itself. The launcher is a flat Android window (shown with lepton-show-flatscreen).
|
||||
needs a fix in WiiCompiled itself. The launcher is a flat Android window (shown with lepton-show-flatscreen) that
|
||||
stays in view after it starts the VR part (QuestActivity, process :game); frame.start_activity makes QuestActivity
|
||||
the start activity (owner-verified 2026-10-05, opens straight in VR), but it skips the launcher's import step, so it
|
||||
stays off by default.
|
||||
tested_version: 0.4.0-quest
|
||||
engine: Other
|
||||
xr: OpenXR
|
||||
@@ -20,5 +25,5 @@ device:
|
||||
- device.text_input_window
|
||||
verified:
|
||||
date: '2026-10-04'
|
||||
updated: '2026-10-04'
|
||||
updated: '2026-10-05'
|
||||
source_hint: WiiCompiled
|
||||
+5
-2
@@ -25,17 +25,21 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
|
||||
| H.U.N.T | Quest | ✅ Works | |
|
||||
| I Am Monkey | Quest | ✅ Works | |
|
||||
| In Death: Unchained | Quest | ✅ Works | |
|
||||
| Into The Radius 2 | Quest | ✅ Works | |
|
||||
| Job Simulator | Quest | ✅ Works | |
|
||||
| Keep Talking and Nobody Explodes | Quest | ✅ Works | |
|
||||
| LEGO® Bricktales | Quest | ✅ Works | |
|
||||
| Marvel's Deadpool VR | Quest | ✅ Works | |
|
||||
| Marvel's Iron Man VR | Quest | ✅ Works | |
|
||||
| Medieval Dynasty New Settlement | Quest | ✅ Works | |
|
||||
| Mobile Suit Gundam: Silver Phantom | Quest | ✅ Works | |
|
||||
| Nano | Quest | ✅ Works | |
|
||||
| NEX Player | Quest | ✅ Works | |
|
||||
| NOPE CHALLENGE | Quest | ✅ Works | |
|
||||
| palazzo_santacruz | Quest | ✅ Works | |
|
||||
| Path of the Warrior | Quest | ✅ Works | |
|
||||
| PowerWash Simulator VR | Quest | ✅ Works | |
|
||||
| QuestCraft | Quest | ✅ Works | |
|
||||
| Rick and Morty: Virtual Rick-ality | PC VR | ✅ Works | |
|
||||
| Riven | Quest | ✅ Works | |
|
||||
| Robo Recall | Quest | ✅ Works | |
|
||||
@@ -44,6 +48,7 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
|
||||
| Stremio | Quest | ✅ Works | |
|
||||
| SUPERHOT VR | PC VR | ✅ Works | |
|
||||
| SUPERHOT VR | Quest | ✅ Works | |
|
||||
| TetrisEffect | Quest | ✅ Works | |
|
||||
| The Climb 2 | Quest | ✅ Works | |
|
||||
| Toy Master | Quest | ✅ Works | |
|
||||
| Under Cover | Quest | ✅ Works | |
|
||||
@@ -54,11 +59,9 @@ Generated from [catalog/games](../catalog/games) by `scripts/compat_list.py`.
|
||||
| Arcsmith | Quest | ⚠️ Works with issues | Right eye distorts during movement (unresolved; swap, tracking, Valve layers, depth and pacing ruled out). |
|
||||
| Assassin's Creed Nexus | Quest | ⚠️ Works with issues | Some launch warning text is still upside down; the rest of the UI is fixed by flip emulation. |
|
||||
| I Am Cat | Quest | ⚠️ Works with issues | The view vibrates slightly, even when holding still. |
|
||||
| Into The Radius 2 | Quest | ⚠️ Works with issues | Space warp is turned off (no flickering textures in the headset); the headset's brief focus losses are hidden (focus_hold, up to 2.5 s) because the game paus… |
|
||||
| Lucky's Tale | Quest | ⚠️ Works with issues | Runs out of memory within a few minutes and freezes the Frame until the game is killed. |
|
||||
| Myst | Quest | ⚠️ Works with issues | Minor graphical glitches on some objects. |
|
||||
| Phantom: Covert Ops | Quest | ⚠️ Works with issues | DLC/store button crashes (no Meta store). |
|
||||
| QuestCraft | Quest | ⚠️ Works with issues | The launcher runs, but Minecraft crashes while starting its graphics (OpenGL error 1282). |
|
||||
| Silhouette | Quest | ⚠️ Works with issues | Hand-tracking game; the Frame synthesizes hands from controllers, so it is janky. |
|
||||
| Time Stall | Quest | ⚠️ Works with issues | Both eyes distort during movement (unresolved). |
|
||||
| WiiCompiled VR | Quest | ⚠️ Works with issues | To add a game: in FramePort's Files tab, upload your .wcgame file to this game's storage, folder Android/data/org.wiicompiled.quest/files/WiiCompiledOpenXRVR… |
|
||||
|
||||
+14
-4
@@ -10,7 +10,7 @@ timefix OpenXR layer for Proton games (linux-arm64, glibc; the NDK's clang build
|
||||
OculusHMDConnected helper for Rift games under Proton (win-x64 PE; the NDK's clang + lld-link, no Windows SDK), and
|
||||
rewrites artifacts/SHA256SUMS. Run `frameport parity` afterwards to see which games change.
|
||||
|
||||
python native/build.py [--only adapter,bridge,compat,langpack,glshim,dex,xrlayer,oculushmd,xrshim,vkshim,ovrpshim,vrsettings] [--ndk PATH]
|
||||
python native/build.py [--only adapter,bridge,compat,langpack,glshim,eglfmt,dex,xrlayer,oculushmd,xrshim,vkshim,ovrpshim,vrsettings] [--ndk PATH]
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -239,6 +239,16 @@ def build_glshim(tc: Path):
|
||||
"-Wl,-z,max-page-size=16384", "glshim.c", "-ldl", "-llog", "-o", ART / "arm64-v8a/libglshim.so"], cwd=src)
|
||||
|
||||
|
||||
def build_eglfmt(tc: Path):
|
||||
"""Depth-format shim (see glshim/eglfmt.c) that GL-to-GLES wrappers (QuestCraft's LTW) load in place of libEGL.so.
|
||||
Named libfpg.so: no longer than "libEGL.so", whose dlopen string in the wrapper is rewritten in place. Linked to
|
||||
libEGL so a dlsym on its handle still finds every EGL function."""
|
||||
src = HERE / "glshim"
|
||||
run([exe(tc, "aarch64-linux-android29-clang"), "-shared", "-fPIC", "-O2", "-Wall", "-Wextra", "-Werror",
|
||||
"-fvisibility=hidden", "-Wl,-soname,libfpg.so", "-Wl,-z,max-page-size=16384", "eglfmt.c",
|
||||
"-Wl,--no-as-needed", "-lEGL", "-Wl,--as-needed", "-ldl", "-llog", "-o", ART / "arm64-v8a/libfpg.so"], cwd=src)
|
||||
|
||||
|
||||
def build_xrshim(tc: Path):
|
||||
"""FrameBridge extension shim (see xrshim/xrshim.c): DT_NEEDED-injected in front of overport's libopenxr_loader.so."""
|
||||
src = HERE / "xrshim"
|
||||
@@ -308,7 +318,7 @@ def write_sums():
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--only", default="adapter,bridge,compat,langpack,glshim,dex,xrlayer,oculushmd,xrshim,vkshim,ovrpshim,vrsettings")
|
||||
ap.add_argument("--only", default="adapter,bridge,compat,langpack,glshim,eglfmt,dex,xrlayer,oculushmd,xrshim,vkshim,ovrpshim,vrsettings")
|
||||
ap.add_argument("--ndk")
|
||||
args = ap.parse_args()
|
||||
parts = set(args.only.split(","))
|
||||
@@ -317,11 +327,11 @@ def main():
|
||||
tc = clang_dir(ndk(args.ndk)) if parts - {"dex"} else None
|
||||
steps = {"adapter": lambda: build_adapter(tc), "bridge": lambda: build_bridge(tc), "compat": lambda: build_compat(tc),
|
||||
"langpack": lambda: build_langpack(tc),
|
||||
"glshim": lambda: build_glshim(tc), "xrshim": lambda: build_xrshim(tc), "dex": build_dex, "xrlayer": lambda: build_xrlayer(tc),
|
||||
"glshim": lambda: build_glshim(tc), "eglfmt": lambda: build_eglfmt(tc), "xrshim": lambda: build_xrshim(tc), "dex": build_dex, "xrlayer": lambda: build_xrlayer(tc),
|
||||
"oculushmd": lambda: build_oculushmd(tc), "vkshim": lambda: build_vkshim(tc),
|
||||
"ovrpshim": lambda: build_ovrpshim(tc),
|
||||
"vrsettings": lambda: build_vrsettings(tc)}
|
||||
for name in ("adapter", "bridge", "compat", "langpack", "glshim", "xrshim", "vkshim", "ovrpshim", "dex", "xrlayer", "oculushmd", "vrsettings"):
|
||||
for name in ("adapter", "bridge", "compat", "langpack", "glshim", "eglfmt", "xrshim", "vkshim", "ovrpshim", "dex", "xrlayer", "oculushmd", "vrsettings"):
|
||||
if name in parts:
|
||||
log(f"build {name}")
|
||||
steps[name]()
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// FramePort depth-format shim for GL-to-GLES wrappers (QuestCraft's LTW): desktop OpenGL's sized depth format
|
||||
// GL_DEPTH_COMPONENT32 doesn't exist in OpenGL ES. Qualcomm's Quest driver accepts it anyway; the Frame's Mesa (Zink)
|
||||
// rejects it (GL_INVALID_OPERATION in glTexImage2D), so Minecraft's depth textures never exist, every framebuffer that
|
||||
// uses them is incomplete and the picture stays black. LTW resolves every GLES function through eglGetProcAddress from
|
||||
// a libEGL it dlopens itself; FramePort points that dlopen string at this library (patches/frame/ltw_depth.py), which
|
||||
// hands back wrappers for the texture/renderbuffer allocation functions and the real functions for everything else:
|
||||
// GL_DEPTH_COMPONENT32 -> GL_DEPTH_COMPONENT32F (GL_DEPTH_COMPONENT24 when pixel data comes as GL_UNSIGNED_INT),
|
||||
// unsized GL_DEPTH_COMPONENT with GL_FLOAT data -> GL_DEPTH_COMPONENT32F.
|
||||
#define _GNU_SOURCE
|
||||
#include <EGL/egl.h>
|
||||
#include <GLES3/gl32.h>
|
||||
#include <android/log.h>
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
|
||||
#define LOG(...) __android_log_print(ANDROID_LOG_INFO, "FrameBridge", __VA_ARGS__)
|
||||
#define EXPORT __attribute__((visibility("default")))
|
||||
#ifndef GL_DEPTH_COMPONENT32
|
||||
#define GL_DEPTH_COMPONENT32 0x81A7
|
||||
#endif
|
||||
|
||||
typedef __eglMustCastToProperFunctionPointerType FnPtr;
|
||||
static FnPtr (*real_gpa)(const char *);
|
||||
static pthread_once_t once = PTHREAD_ONCE_INIT;
|
||||
static int logged;
|
||||
|
||||
static void init(void) {
|
||||
void *egl = dlopen("libEGL.so", RTLD_NOW | RTLD_LOCAL);
|
||||
real_gpa = egl ? (FnPtr (*)(const char *))dlsym(egl, "eglGetProcAddress") : NULL;
|
||||
LOG("depth format shim: libEGL.so %s", real_gpa ? "OK" : "MISSING");
|
||||
}
|
||||
|
||||
// the ES internal format for a desktop depth request (`type` = the pixel data type, 0 when there is none)
|
||||
static GLint fix(GLint internal, GLenum type, const char *fn) {
|
||||
GLint out = internal;
|
||||
if (internal == GL_DEPTH_COMPONENT32) out = type == GL_UNSIGNED_INT ? GL_DEPTH_COMPONENT24 : GL_DEPTH_COMPONENT32F;
|
||||
else if (internal == GL_DEPTH_COMPONENT && type == GL_FLOAT) out = GL_DEPTH_COMPONENT32F;
|
||||
if (out != internal && logged < 8) {
|
||||
logged++;
|
||||
LOG("depth format shim: %s 0x%x -> 0x%x", fn, internal, out);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
static PFNGLTEXIMAGE2DPROC r_ti2;
|
||||
static PFNGLTEXIMAGE3DPROC r_ti3;
|
||||
static PFNGLTEXSTORAGE2DPROC r_ts2;
|
||||
static PFNGLTEXSTORAGE3DPROC r_ts3;
|
||||
static PFNGLTEXSTORAGE2DMULTISAMPLEPROC r_ts2ms;
|
||||
static PFNGLTEXSTORAGE3DMULTISAMPLEPROC r_ts3ms;
|
||||
static PFNGLRENDERBUFFERSTORAGEPROC r_rbs;
|
||||
static PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC r_rbsms;
|
||||
|
||||
static void GL_APIENTRY w_ti2(GLenum t, GLint l, GLint i, GLsizei w, GLsizei h, GLint b, GLenum f, GLenum ty, const void *d) {
|
||||
r_ti2(t, l, fix(i, ty, "glTexImage2D"), w, h, b, f, ty, d);
|
||||
}
|
||||
static void GL_APIENTRY w_ti3(GLenum t, GLint l, GLint i, GLsizei w, GLsizei h, GLsizei dp, GLint b, GLenum f, GLenum ty,
|
||||
const void *d) {
|
||||
r_ti3(t, l, fix(i, ty, "glTexImage3D"), w, h, dp, b, f, ty, d);
|
||||
}
|
||||
static void GL_APIENTRY w_ts2(GLenum t, GLsizei l, GLenum i, GLsizei w, GLsizei h) {
|
||||
r_ts2(t, l, (GLenum)fix((GLint)i, 0, "glTexStorage2D"), w, h);
|
||||
}
|
||||
static void GL_APIENTRY w_ts3(GLenum t, GLsizei l, GLenum i, GLsizei w, GLsizei h, GLsizei d) {
|
||||
r_ts3(t, l, (GLenum)fix((GLint)i, 0, "glTexStorage3D"), w, h, d);
|
||||
}
|
||||
static void GL_APIENTRY w_ts2ms(GLenum t, GLsizei s, GLenum i, GLsizei w, GLsizei h, GLboolean fl) {
|
||||
r_ts2ms(t, s, (GLenum)fix((GLint)i, 0, "glTexStorage2DMultisample"), w, h, fl);
|
||||
}
|
||||
static void GL_APIENTRY w_ts3ms(GLenum t, GLsizei s, GLenum i, GLsizei w, GLsizei h, GLsizei d, GLboolean fl) {
|
||||
r_ts3ms(t, s, (GLenum)fix((GLint)i, 0, "glTexStorage3DMultisample"), w, h, d, fl);
|
||||
}
|
||||
static void GL_APIENTRY w_rbs(GLenum t, GLenum i, GLsizei w, GLsizei h) {
|
||||
r_rbs(t, (GLenum)fix((GLint)i, 0, "glRenderbufferStorage"), w, h);
|
||||
}
|
||||
static void GL_APIENTRY w_rbsms(GLenum t, GLsizei s, GLenum i, GLsizei w, GLsizei h) {
|
||||
r_rbsms(t, s, (GLenum)fix((GLint)i, 0, "glRenderbufferStorageMultisample"), w, h);
|
||||
}
|
||||
|
||||
EXPORT FnPtr eglGetProcAddress(const char *name) {
|
||||
pthread_once(&once, init);
|
||||
FnPtr fn = real_gpa && name ? real_gpa(name) : NULL;
|
||||
if (!fn) return fn;
|
||||
#define WRAP(sym, real, w) if (!strcmp(name, sym)) { real = (void *)fn; return (FnPtr)w; }
|
||||
WRAP("glTexImage2D", r_ti2, w_ti2)
|
||||
WRAP("glTexImage3D", r_ti3, w_ti3)
|
||||
WRAP("glTexStorage2D", r_ts2, w_ts2)
|
||||
WRAP("glTexStorage3D", r_ts3, w_ts3)
|
||||
WRAP("glTexStorage2DMultisample", r_ts2ms, w_ts2ms)
|
||||
WRAP("glTexStorage3DMultisample", r_ts3ms, w_ts3ms)
|
||||
WRAP("glRenderbufferStorage", r_rbs, w_rbs)
|
||||
WRAP("glRenderbufferStorageMultisample", r_rbsms, w_rbsms)
|
||||
#undef WRAP
|
||||
return fn;
|
||||
}
|
||||
+293
-2
@@ -13,6 +13,21 @@
|
||||
// copied with extra words inserted at a byte offset, e.g. stores that initialize locals a shader reads before writing
|
||||
// (an undefined loop counter hung the GPU in VR4's campaign). Every other module passes through unchanged.
|
||||
// Format: vk_shader_fix=<size>:<sha256 hex>:<byte offset>:<word>,<word>,...[;<next fix>]
|
||||
//
|
||||
// Query slots (adapter setting vk_query_slots=2, per game): with multiview, Vulkan counts a query that runs in a
|
||||
// multiview render pass as one query per view (N consecutive indices). Mesa's drivers (the Frame's Turnip) write a
|
||||
// zero result into the extra views' slots; Meta's Quest driver doesn't. Engines that allocate one slot per query
|
||||
// (Into The Radius 2, Unreal 5) then have the next object's occlusion query overwritten with "0 samples" and cull it:
|
||||
// models pop in and out. With the setting, occlusion pools get N slots per query; query i uses slot N*i, so the extra
|
||||
// views land in N*i+1.., and results are read from slot N*i only (view 0's count; Turnip counts every view there).
|
||||
//
|
||||
// Spec fixes (vk_spec_fixes=1, per game; found with the validation layer in Into The Radius 2, Unreal 5):
|
||||
// * depth/stencil images created without VK_IMAGE_USAGE_TRANSFER_DST_BIT are cleared with vkCmdClearDepthStencilImage
|
||||
// (VUID-vkCmdClearDepthStencilImage-pRanges-02659); Mesa's Turnip picks the image's compression from its usage, so
|
||||
// the flag is added at vkCreateImage.
|
||||
// * subpasses with Qualcomm's shader resolve (VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM) also name a depth
|
||||
// resolve attachment for a single-sampled depth attachment (VUID-VkSubpassDescription2-flags-04908, -03179): the
|
||||
// resolve is dropped (there is nothing to resolve from one sample).
|
||||
#define _GNU_SOURCE
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <android/log.h>
|
||||
@@ -74,12 +89,23 @@ static void parse_fixes(char *v) {
|
||||
}
|
||||
}
|
||||
|
||||
static int query_slots = 1; // vk_query_slots: slots per occlusion query (1 = untouched)
|
||||
static int spec_fixes; // vk_spec_fixes: make two Unreal habits valid Vulkan (depth clears, depth resolves)
|
||||
#define VALIDATION_LAYER "VK_LAYER_KHRONOS_validation"
|
||||
static int validation; // vk_validation: add Khronos' validation layer (bundled in the APK) to the instance
|
||||
|
||||
static void read_settings(const char *path) {
|
||||
FILE *f = fopen(path, "r");
|
||||
if (!f) return;
|
||||
char line[4096];
|
||||
while (fgets(line, sizeof line, f)) {
|
||||
line[strcspn(line, "\r\n")] = 0;
|
||||
if (!strncmp(line, "vk_validation=", 14)) validation = atoi(line + 14) != 0;
|
||||
if (!strncmp(line, "vk_spec_fixes=", 14)) spec_fixes = atoi(line + 14) != 0;
|
||||
if (!strncmp(line, "vk_query_slots=", 15)) {
|
||||
int v = atoi(line + 15);
|
||||
query_slots = v == 1 ? 2 : v >= 2 && v <= 4 ? v : 1; // 1 = on (the settings dialog's switch) = 2 slots
|
||||
}
|
||||
if (!strncmp(line, "vk_shader_fix=", 14)) {
|
||||
nfixes = 0; // later sources override earlier ones (as for the adapter's settings)
|
||||
parse_fixes(line + 14);
|
||||
@@ -182,6 +208,10 @@ static uint32_t *fixed_shader(const uint32_t *code, size_t size, size_t *out_siz
|
||||
static void init(void) {
|
||||
read_all_settings();
|
||||
if (nfixes) LOG("vk shim: %d shader fix(es) configured", nfixes);
|
||||
if (query_slots > 1) LOG("vk shim: %d slots per occlusion query", query_slots);
|
||||
if (validation) LOG("vk shim: adding %s to the instance", VALIDATION_LAYER);
|
||||
if (spec_fixes) LOG("vk shim: Vulkan spec fixes on (depth images can be cleared, no depth resolve in shader-resolve "
|
||||
"subpasses)");
|
||||
real_vk = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
|
||||
if (real_vk) {
|
||||
real_gipa = (PFN_vkGetInstanceProcAddr)dlsym(real_vk, "vkGetInstanceProcAddr");
|
||||
@@ -318,6 +348,8 @@ static const void *clean_chain(Arena *a, const void *head, int *fixes) {
|
||||
return first;
|
||||
}
|
||||
|
||||
static int resolves_logged;
|
||||
|
||||
static VkRenderPassCreateInfo2 clean_create_info(Arena *a, const VkRenderPassCreateInfo2 *ci, int *fixes) {
|
||||
VkRenderPassCreateInfo2 out = *ci;
|
||||
out.pNext = clean_chain(a, ci->pNext, fixes);
|
||||
@@ -342,6 +374,27 @@ static VkRenderPassCreateInfo2 clean_create_info(Arena *a, const VkRenderPassCre
|
||||
out.pSubpasses = sp;
|
||||
}
|
||||
}
|
||||
if (spec_fixes && out.pSubpasses) {
|
||||
VkSubpassDescription2 *sp = (VkSubpassDescription2 *)out.pSubpasses;
|
||||
for (uint32_t i = 0; i < ci->subpassCount; i++) {
|
||||
if (!(sp[i].flags & 0x8 /* VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM */) || !sp[i].pDepthStencilAttachment)
|
||||
continue;
|
||||
uint32_t att = sp[i].pDepthStencilAttachment->attachment;
|
||||
if (att == VK_ATTACHMENT_UNUSED || att >= ci->attachmentCount || !ci->pAttachments ||
|
||||
ci->pAttachments[att].samples != VK_SAMPLE_COUNT_1_BIT)
|
||||
continue;
|
||||
for (VkBaseOutStructure *n = (VkBaseOutStructure *)sp[i].pNext; n; n = n->pNext) {
|
||||
if (n->sType != VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE) continue;
|
||||
VkSubpassDescriptionDepthStencilResolve *r = (void *)n;
|
||||
if (r->pDepthStencilResolveAttachment &&
|
||||
r->pDepthStencilResolveAttachment->attachment != VK_ATTACHMENT_UNUSED) {
|
||||
r->pDepthStencilResolveAttachment = NULL;
|
||||
(*fixes)++;
|
||||
if (resolves_logged++ < 5) LOG("vk shim: dropped the depth resolve of shader-resolve subpass %u", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ci->pDependencies && ci->dependencyCount) {
|
||||
VkSubpassDependency2 *dep = arena_dup(a, ci->pDependencies, sizeof *dep * ci->dependencyCount);
|
||||
if (dep) {
|
||||
@@ -356,8 +409,11 @@ static VkRenderPassCreateInfo2 clean_create_info(Arena *a, const VkRenderPassCre
|
||||
// ---------------------------------------------------------------- entry points
|
||||
|
||||
#define MAX_DEVICES 8
|
||||
enum { FN_RP2, FN_RP2KHR, FN_CSM, FN_COUNT };
|
||||
static const char *const FN_NAMES[FN_COUNT] = {"vkCreateRenderPass2", "vkCreateRenderPass2KHR", "vkCreateShaderModule"};
|
||||
enum { FN_RP2, FN_RP2KHR, FN_CSM, FN_CIMG, FN_CQP, FN_DQP, FN_BQ, FN_EQ, FN_CRQP, FN_RQP, FN_RQPEXT, FN_GQPR, FN_CCQPR, FN_COUNT };
|
||||
static const char *const FN_NAMES[FN_COUNT] = {
|
||||
"vkCreateRenderPass2", "vkCreateRenderPass2KHR", "vkCreateShaderModule", "vkCreateImage", "vkCreateQueryPool", "vkDestroyQueryPool",
|
||||
"vkCmdBeginQuery", "vkCmdEndQuery", "vkCmdResetQueryPool", "vkResetQueryPool", "vkResetQueryPoolEXT",
|
||||
"vkGetQueryPoolResults", "vkCmdCopyQueryPoolResults"};
|
||||
static struct { VkDevice device; PFN_vkVoidFunction fn[FN_COUNT]; } devices[MAX_DEVICES];
|
||||
static PFN_vkCreateRenderPass2 fallback_rp2khr; // from vkGetInstanceProcAddr
|
||||
static pthread_mutex_t dev_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
@@ -428,6 +484,223 @@ EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, cons
|
||||
return r;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- query slots
|
||||
|
||||
// Command buffer functions carry no VkDevice: their next implementation is the one the (single) game device got.
|
||||
static PFN_vkVoidFunction cmd_fn[FN_COUNT];
|
||||
static PFN_vkVoidFunction any_fn(VkDevice device, int which) {
|
||||
PFN_vkVoidFunction fn = device ? device_fn(device, which) : NULL;
|
||||
if (!fn) fn = cmd_fn[which];
|
||||
if (!fn && real_vk) fn = (PFN_vkVoidFunction)dlsym(real_vk, FN_NAMES[which]);
|
||||
return fn;
|
||||
}
|
||||
|
||||
#define MAX_POOLS 4096
|
||||
static uint64_t occlusion_pools[MAX_POOLS]; // open addressing; 0 = empty, 1 = deleted
|
||||
static pthread_mutex_t pool_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static int pools_logged;
|
||||
|
||||
static unsigned pool_hash(uint64_t h) { return (unsigned)((h * 0x9E3779B97F4A7C15ull) >> 52) % MAX_POOLS; }
|
||||
|
||||
static void pool_add(VkQueryPool pool) {
|
||||
uint64_t h = (uint64_t)pool;
|
||||
pthread_mutex_lock(&pool_lock);
|
||||
for (unsigned i = pool_hash(h), n = 0; n < MAX_POOLS; i = (i + 1) % MAX_POOLS, n++)
|
||||
if (occlusion_pools[i] <= 1) { occlusion_pools[i] = h; break; }
|
||||
pthread_mutex_unlock(&pool_lock);
|
||||
}
|
||||
|
||||
static int pool_slot(VkQueryPool pool, int remove) {
|
||||
uint64_t h = (uint64_t)pool;
|
||||
if (h <= 1) return 0;
|
||||
int found = 0;
|
||||
pthread_mutex_lock(&pool_lock);
|
||||
for (unsigned i = pool_hash(h), n = 0; n < MAX_POOLS && occlusion_pools[i]; i = (i + 1) % MAX_POOLS, n++)
|
||||
if (occlusion_pools[i] == h) {
|
||||
found = 1;
|
||||
if (remove) occlusion_pools[i] = 1;
|
||||
break;
|
||||
}
|
||||
pthread_mutex_unlock(&pool_lock);
|
||||
return found;
|
||||
}
|
||||
|
||||
// the remapped first query of `pool` (unchanged for pools that aren't remapped)
|
||||
static uint32_t q(VkQueryPool pool, uint32_t query) { return pool_slot(pool, 0) ? query * (uint32_t)query_slots : query; }
|
||||
|
||||
static VKAPI_ATTR VkResult VKAPI_CALL create_query_pool(VkDevice device, const VkQueryPoolCreateInfo *ci,
|
||||
const VkAllocationCallbacks *alloc, VkQueryPool *pool) {
|
||||
PFN_vkCreateQueryPool real = (PFN_vkCreateQueryPool)any_fn(device, FN_CQP);
|
||||
if (!real) return VK_ERROR_INITIALIZATION_FAILED;
|
||||
if (!ci || ci->queryType != VK_QUERY_TYPE_OCCLUSION || query_slots < 2) return real(device, ci, alloc, pool);
|
||||
VkQueryPoolCreateInfo copy = *ci;
|
||||
copy.queryCount = ci->queryCount * (uint32_t)query_slots;
|
||||
VkResult r = real(device, ©, alloc, pool);
|
||||
if (r == VK_SUCCESS) {
|
||||
pool_add(*pool);
|
||||
if (pools_logged++ < 5)
|
||||
LOG("vk shim: occlusion query pool %u -> %u slots", ci->queryCount, copy.queryCount);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
static VKAPI_ATTR void VKAPI_CALL destroy_query_pool(VkDevice device, VkQueryPool pool, const VkAllocationCallbacks *alloc) {
|
||||
PFN_vkDestroyQueryPool real = (PFN_vkDestroyQueryPool)any_fn(device, FN_DQP);
|
||||
pool_slot(pool, 1);
|
||||
if (real) real(device, pool, alloc);
|
||||
}
|
||||
|
||||
static VKAPI_ATTR void VKAPI_CALL cmd_begin_query(VkCommandBuffer cb, VkQueryPool pool, uint32_t query,
|
||||
VkQueryControlFlags flags) {
|
||||
PFN_vkCmdBeginQuery real = (PFN_vkCmdBeginQuery)any_fn(NULL, FN_BQ);
|
||||
if (real) real(cb, pool, q(pool, query), flags);
|
||||
}
|
||||
|
||||
static VKAPI_ATTR void VKAPI_CALL cmd_end_query(VkCommandBuffer cb, VkQueryPool pool, uint32_t query) {
|
||||
PFN_vkCmdEndQuery real = (PFN_vkCmdEndQuery)any_fn(NULL, FN_EQ);
|
||||
if (real) real(cb, pool, q(pool, query));
|
||||
}
|
||||
|
||||
static uint32_t span(VkQueryPool pool, uint32_t count) { return pool_slot(pool, 0) ? count * (uint32_t)query_slots : count; }
|
||||
|
||||
static VKAPI_ATTR void VKAPI_CALL cmd_reset_query_pool(VkCommandBuffer cb, VkQueryPool pool, uint32_t first, uint32_t count) {
|
||||
PFN_vkCmdResetQueryPool real = (PFN_vkCmdResetQueryPool)any_fn(NULL, FN_CRQP);
|
||||
if (real) real(cb, pool, q(pool, first), span(pool, count));
|
||||
}
|
||||
|
||||
static void reset_query_pool(VkDevice device, VkQueryPool pool, uint32_t first, uint32_t count, int ext) {
|
||||
PFN_vkResetQueryPool real = (PFN_vkResetQueryPool)any_fn(device, ext ? FN_RQPEXT : FN_RQP);
|
||||
if (real) real(device, pool, q(pool, first), span(pool, count));
|
||||
}
|
||||
static VKAPI_ATTR void VKAPI_CALL host_reset_query_pool(VkDevice d, VkQueryPool p, uint32_t f, uint32_t c) { reset_query_pool(d, p, f, c, 0); }
|
||||
static VKAPI_ATTR void VKAPI_CALL host_reset_query_pool_ext(VkDevice d, VkQueryPool p, uint32_t f, uint32_t c) { reset_query_pool(d, p, f, c, 1); }
|
||||
|
||||
// Results come from slot N*i of each query, one query at a time: the extra slots are only written in multiview passes,
|
||||
// so reading them (with VK_QUERY_RESULT_WAIT_BIT) could wait forever.
|
||||
static VKAPI_ATTR VkResult VKAPI_CALL get_query_pool_results(VkDevice device, VkQueryPool pool, uint32_t first, uint32_t count,
|
||||
size_t size, void *data, VkDeviceSize stride,
|
||||
VkQueryResultFlags flags) {
|
||||
PFN_vkGetQueryPoolResults real = (PFN_vkGetQueryPoolResults)any_fn(device, FN_GQPR);
|
||||
if (!real) return VK_ERROR_INITIALIZATION_FAILED;
|
||||
if (!pool_slot(pool, 0) || !count) return real(device, pool, first, count, size, data, stride, flags);
|
||||
VkResult result = VK_SUCCESS;
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
size_t offset = (size_t)(i * stride);
|
||||
if (offset >= size) break;
|
||||
VkResult r = real(device, pool, (first + i) * (uint32_t)query_slots, 1, size - offset, (uint8_t *)data + offset,
|
||||
stride, flags);
|
||||
if (r < 0) return r;
|
||||
if (r == VK_NOT_READY) result = VK_NOT_READY;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static VKAPI_ATTR void VKAPI_CALL cmd_copy_query_pool_results(VkCommandBuffer cb, VkQueryPool pool, uint32_t first,
|
||||
uint32_t count, VkBuffer buffer, VkDeviceSize offset,
|
||||
VkDeviceSize stride, VkQueryResultFlags flags) {
|
||||
PFN_vkCmdCopyQueryPoolResults real = (PFN_vkCmdCopyQueryPoolResults)any_fn(NULL, FN_CCQPR);
|
||||
if (!real) return;
|
||||
if (!pool_slot(pool, 0)) { real(cb, pool, first, count, buffer, offset, stride, flags); return; }
|
||||
for (uint32_t i = 0; i < count; i++)
|
||||
real(cb, pool, (first + i) * (uint32_t)query_slots, 1, buffer, offset + i * stride, stride, flags);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- spec fixes: depth images
|
||||
|
||||
static int is_depth_format(VkFormat f) {
|
||||
return f == VK_FORMAT_D16_UNORM || f == VK_FORMAT_X8_D24_UNORM_PACK32 || f == VK_FORMAT_D32_SFLOAT ||
|
||||
f == VK_FORMAT_S8_UINT || f == VK_FORMAT_D16_UNORM_S8_UINT || f == VK_FORMAT_D24_UNORM_S8_UINT ||
|
||||
f == VK_FORMAT_D32_SFLOAT_S8_UINT;
|
||||
}
|
||||
static int images_logged;
|
||||
|
||||
static VKAPI_ATTR VkResult VKAPI_CALL create_image(VkDevice device, const VkImageCreateInfo *ci,
|
||||
const VkAllocationCallbacks *alloc, VkImage *image) {
|
||||
PFN_vkCreateImage real = (PFN_vkCreateImage)any_fn(device, FN_CIMG);
|
||||
if (!real) return VK_ERROR_INITIALIZATION_FAILED;
|
||||
if (!spec_fixes || !ci || !is_depth_format(ci->format) || !(ci->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) ||
|
||||
(ci->usage & (VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT))) // transient: no
|
||||
return real(device, ci, alloc, image);
|
||||
VkImageCreateInfo copy = *ci;
|
||||
copy.usage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||
VkResult r = real(device, ©, alloc, image);
|
||||
if (images_logged++ < 5) LOG("vk shim: depth image %ux%u format %d can be cleared now: %d", ci->extent.width,
|
||||
ci->extent.height, ci->format, r);
|
||||
if (r != VK_SUCCESS) r = real(device, ci, alloc, image); // the flag isn't allowed here: as the game asked
|
||||
return r;
|
||||
}
|
||||
|
||||
EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice d, const VkImageCreateInfo *ci, const VkAllocationCallbacks *a,
|
||||
VkImage *img) {
|
||||
pthread_once(&once, init);
|
||||
return create_image(d, ci, a, img);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- validation (diagnostics)
|
||||
|
||||
static PFN_vkCreateInstance real_ci;
|
||||
|
||||
static VKAPI_ATTR VkResult VKAPI_CALL create_instance(const VkInstanceCreateInfo *ci, const VkAllocationCallbacks *a,
|
||||
VkInstance *inst) {
|
||||
if (!real_ci && real_vk) real_ci = (PFN_vkCreateInstance)dlsym(real_vk, "vkCreateInstance");
|
||||
if (!real_ci) return VK_ERROR_INITIALIZATION_FAILED;
|
||||
if (!validation || !ci) return real_ci(ci, a, inst);
|
||||
for (uint32_t i = 0; i < ci->enabledLayerCount; i++)
|
||||
if (!strcmp(ci->ppEnabledLayerNames[i], VALIDATION_LAYER)) return real_ci(ci, a, inst);
|
||||
const char **names = malloc(sizeof(char *) * (ci->enabledLayerCount + 1));
|
||||
if (!names) return real_ci(ci, a, inst);
|
||||
for (uint32_t i = 0; i < ci->enabledLayerCount; i++) names[i] = ci->ppEnabledLayerNames[i];
|
||||
names[ci->enabledLayerCount] = VALIDATION_LAYER;
|
||||
VkInstanceCreateInfo copy = *ci;
|
||||
copy.enabledLayerCount = ci->enabledLayerCount + 1;
|
||||
copy.ppEnabledLayerNames = names;
|
||||
VkResult r = real_ci(©, a, inst);
|
||||
LOG("vk shim: vkCreateInstance with %s: %d", VALIDATION_LAYER, r);
|
||||
if (r == VK_ERROR_LAYER_NOT_PRESENT) r = real_ci(ci, a, inst); // not bundled: start without it
|
||||
free(names);
|
||||
return r;
|
||||
}
|
||||
|
||||
EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *ci, const VkAllocationCallbacks *a,
|
||||
VkInstance *inst) {
|
||||
pthread_once(&once, init);
|
||||
return create_instance(ci, a, inst);
|
||||
}
|
||||
|
||||
// The same entry points for engines that dlsym them from the shim instead of asking vkGet*ProcAddr
|
||||
EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice d, const VkQueryPoolCreateInfo *ci,
|
||||
const VkAllocationCallbacks *a, VkQueryPool *p) {
|
||||
pthread_once(&once, init);
|
||||
return create_query_pool(d, ci, a, p);
|
||||
}
|
||||
EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyQueryPool(VkDevice d, VkQueryPool p, const VkAllocationCallbacks *a) {
|
||||
pthread_once(&once, init);
|
||||
destroy_query_pool(d, p, a);
|
||||
}
|
||||
EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBeginQuery(VkCommandBuffer cb, VkQueryPool p, uint32_t i, VkQueryControlFlags f) {
|
||||
pthread_once(&once, init);
|
||||
cmd_begin_query(cb, p, i, f);
|
||||
}
|
||||
EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer cb, VkQueryPool p, uint32_t i) {
|
||||
pthread_once(&once, init);
|
||||
cmd_end_query(cb, p, i);
|
||||
}
|
||||
EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer cb, VkQueryPool p, uint32_t f, uint32_t c) {
|
||||
pthread_once(&once, init);
|
||||
cmd_reset_query_pool(cb, p, f, c);
|
||||
}
|
||||
EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetQueryPoolResults(VkDevice d, VkQueryPool p, uint32_t f, uint32_t c, size_t s,
|
||||
void *data, VkDeviceSize st, VkQueryResultFlags fl) {
|
||||
pthread_once(&once, init);
|
||||
return get_query_pool_results(d, p, f, c, s, data, st, fl);
|
||||
}
|
||||
EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdCopyQueryPoolResults(VkCommandBuffer cb, VkQueryPool p, uint32_t f, uint32_t c,
|
||||
VkBuffer b, VkDeviceSize o, VkDeviceSize st,
|
||||
VkQueryResultFlags fl) {
|
||||
pthread_once(&once, init);
|
||||
cmd_copy_query_pool_results(cb, p, f, c, b, o, st, fl);
|
||||
}
|
||||
|
||||
static int wrapped_index(const char *name) {
|
||||
for (int i = 0; i < FN_COUNT; i++)
|
||||
if (!strcmp(name, FN_NAMES[i])) return i;
|
||||
@@ -439,6 +712,20 @@ static PFN_vkVoidFunction wrap(const char *name) {
|
||||
case FN_RP2: return (PFN_vkVoidFunction)vkCreateRenderPass2;
|
||||
case FN_RP2KHR: return (PFN_vkVoidFunction)create_render_pass2_khr;
|
||||
case FN_CSM: return nfixes ? (PFN_vkVoidFunction)vkCreateShaderModule : NULL; // nothing to fix: no detour
|
||||
case FN_CIMG: return spec_fixes ? (PFN_vkVoidFunction)create_image : NULL;
|
||||
default: break;
|
||||
}
|
||||
if (query_slots < 2) return NULL; // no query remapping: no detours
|
||||
switch (wrapped_index(name)) {
|
||||
case FN_CQP: return (PFN_vkVoidFunction)create_query_pool;
|
||||
case FN_DQP: return (PFN_vkVoidFunction)destroy_query_pool;
|
||||
case FN_BQ: return (PFN_vkVoidFunction)cmd_begin_query;
|
||||
case FN_EQ: return (PFN_vkVoidFunction)cmd_end_query;
|
||||
case FN_CRQP: return (PFN_vkVoidFunction)cmd_reset_query_pool;
|
||||
case FN_RQP: return (PFN_vkVoidFunction)host_reset_query_pool;
|
||||
case FN_RQPEXT: return (PFN_vkVoidFunction)host_reset_query_pool_ext;
|
||||
case FN_GQPR: return (PFN_vkVoidFunction)get_query_pool_results;
|
||||
case FN_CCQPR: return (PFN_vkVoidFunction)cmd_copy_query_pool_results;
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
@@ -460,6 +747,7 @@ EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice dev
|
||||
devices[slot].device = device;
|
||||
devices[slot].fn[which] = fn;
|
||||
}
|
||||
cmd_fn[which] = fn;
|
||||
pthread_mutex_unlock(&dev_lock);
|
||||
return w;
|
||||
}
|
||||
@@ -469,9 +757,12 @@ EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance
|
||||
if (!real_gipa || !name) return NULL;
|
||||
if (!strcmp(name, "vkGetDeviceProcAddr")) return (PFN_vkVoidFunction)vkGetDeviceProcAddr;
|
||||
if (!strcmp(name, "vkGetInstanceProcAddr")) return (PFN_vkVoidFunction)vkGetInstanceProcAddr;
|
||||
if (!strcmp(name, "vkCreateInstance") && validation) return (PFN_vkVoidFunction)vkCreateInstance;
|
||||
PFN_vkVoidFunction fn = real_gipa(instance, name);
|
||||
PFN_vkVoidFunction w = fn ? wrap(name) : NULL;
|
||||
if (!w) return fn;
|
||||
if (!strcmp(name, "vkCreateRenderPass2KHR")) fallback_rp2khr = (PFN_vkCreateRenderPass2)fn;
|
||||
int which = wrapped_index(name);
|
||||
if (which >= FN_CQP && !cmd_fn[which]) cmd_fn[which] = fn;
|
||||
return w;
|
||||
}
|
||||
@@ -202,6 +202,8 @@ def analyze(path: Path, deep: bool = True, data_bytes: int | None = None) -> Ana
|
||||
"oculus_xr_plugin": bool(il2cpp_meta) and b"\0m_StereoRenderingModeAndroid\0" in il2cpp_meta,
|
||||
# Unity's built-in Oculus support checks for Meta's system apps before VR (frame.unity_oculus_check)
|
||||
"unity_oculus_check": b"\0com.oculus.systemactivities\0" in lib_bytes.get("libunity.so", b""),
|
||||
# a 2D launcher activity that starts a separate VR activity (frame.start_activity)
|
||||
"vr_activity": axml.vr_activity(manifest),
|
||||
"unity_version": unity_version(ggm, lib_bytes.get("libunity.so")) if engine == "Unity" else None,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -18,6 +18,10 @@ TYPE_INT_BOOLEAN = 0x12
|
||||
ANDROID_NS = "http://schemas.android.com/apk/res/android"
|
||||
LAUNCHER = "android.intent.category.LAUNCHER"
|
||||
INFO = "android.intent.category.INFO"
|
||||
MAIN = "android.intent.action.MAIN"
|
||||
DEFAULT = "android.intent.category.DEFAULT"
|
||||
VR_CATEGORY = "com.oculus.intent.category.VR"
|
||||
COMPONENTS = ("activity", "activity-alias", "service", "receiver", "provider")
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -226,6 +230,81 @@ def fix_launcher(manifest: bytes) -> bytes | None:
|
||||
return x.bytes() if x.retarget("category", info, launcher) else None
|
||||
|
||||
|
||||
def component_filters(manifest: bytes) -> list[tuple[str, str, list[tuple[str, int, int]]]]:
|
||||
"""[(element, component name, [(element, attr offset, string index)])] for each component's intent-filter
|
||||
children (action/category), in file order. Children follow their component's start element, so the last
|
||||
component seen owns them."""
|
||||
x = Axml(manifest)
|
||||
names = x.strings()
|
||||
out: list = []
|
||||
for el in x.elements():
|
||||
if el.name in COMPONENTS:
|
||||
out.append((el.name, x.attr_str(el, "name") or "", []))
|
||||
elif el.name in ("action", "category") and out:
|
||||
for a in el.attrs:
|
||||
if a.name < len(names) and names[a.name] == "name":
|
||||
idx = a.raw if a.raw < len(names) else a.value
|
||||
out[-1][2].append((el.name, a.offset, idx))
|
||||
return out
|
||||
|
||||
|
||||
def vr_activity(manifest: bytes) -> str | None:
|
||||
"""The activity with Meta's VR category when it isn't the launcher activity (a 2D launcher that starts the VR
|
||||
part, e.g. WiiCompiled's LauncherActivity -> QuestActivity)."""
|
||||
x = Axml(manifest)
|
||||
names = x.strings()
|
||||
vr = launcher = None
|
||||
for el, name, items in component_filters(manifest):
|
||||
cats = {names[i] for kind, _, i in items if kind == "category" and i < len(names)}
|
||||
if el == "activity" and VR_CATEGORY in cats:
|
||||
vr = vr or name
|
||||
if LAUNCHER in cats:
|
||||
launcher = launcher or name
|
||||
return vr if vr and vr != launcher else None
|
||||
|
||||
|
||||
def set_start_activity(manifest: bytes, activity: str) -> bytes | None:
|
||||
"""Make `activity` the one Lepton starts: its MAIN intent-filter gets category LAUNCHER (in place of its VR or
|
||||
DEFAULT category), every other component's LAUNCHER category becomes INFO. Only those attribute values change
|
||||
(per element, not every use of the string). None when `activity` has no MAIN filter or already is the only
|
||||
launcher."""
|
||||
filters = component_filters(manifest)
|
||||
x = Axml(manifest)
|
||||
names = x.strings()
|
||||
short = activity.rsplit(".", 1)[-1]
|
||||
target = next((f for f in filters if f[0] in ("activity", "activity-alias")
|
||||
and (f[1] == activity or f[1].rsplit(".", 1)[-1] == short)), None)
|
||||
if target is None or not any(k == "action" and names[i] == MAIN for k, _, i in target[2] if i < len(names)):
|
||||
return None
|
||||
cats = [(off, names[i]) for k, off, i in target[2] if k == "category" and i < len(names)]
|
||||
others = [off for f in filters if f is not target for k, off, i in f[2]
|
||||
if k == "category" and i < len(names) and names[i] == LAUNCHER]
|
||||
if any(c == LAUNCHER for _, c in cats) and not others:
|
||||
return None
|
||||
pick = next((off for off, c in cats if c == VR_CATEGORY), None) or next(
|
||||
(off for off, c in cats if c == DEFAULT), None) or next((off for off, c in cats if c != LAUNCHER), None)
|
||||
if pick is None and not any(c == LAUNCHER for _, c in cats):
|
||||
return None
|
||||
|
||||
def index(s: str) -> int:
|
||||
i = x.index(s)
|
||||
return i if i is not None else x.append_string(s)
|
||||
launcher, info = index(LAUNCHER), index(INFO)
|
||||
# append_string rebuilds the pool: offsets of attribute records move by the same amount for all of them
|
||||
shift = len(x.data) - len(manifest)
|
||||
for off in others:
|
||||
_set_string_attr(x, off + shift, info)
|
||||
if pick is not None and not any(c == LAUNCHER for _, c in cats):
|
||||
_set_string_attr(x, pick + shift, launcher)
|
||||
return x.bytes()
|
||||
|
||||
|
||||
def _set_string_attr(x: Axml, offset: int, index: int) -> None:
|
||||
struct.pack_into("<I", x.data, offset + 8, index)
|
||||
if x.data[offset + 15] == TYPE_STRING:
|
||||
struct.pack_into("<I", x.data, offset + 16, index)
|
||||
|
||||
|
||||
def set_bool_attr(manifest: bytes, element: str, attr: str, value: bool) -> bytes | None:
|
||||
x = Axml(manifest)
|
||||
return x.bytes() if x.set_bool(element, attr, value) else None
|
||||
|
||||
@@ -261,6 +261,7 @@
|
||||
"Details": "",
|
||||
"Dev builds let you test fixes before they're released. They're less tested than releases and may have bugs. You get the next release as a normal update (you have {version}).": "",
|
||||
"Developer Mode (on the Frame: Settings → System → Developer) lets FramePort find the Frame on your network and connect to it over SSH. The first-time setup command turns it on for you.": "",
|
||||
"Diagnostics: the Vulkan shim (frame.vk_sanitize) adds Khronos' validation layer to the game's instance; its findings go to launch.log. The layer library (libVkLayer_khronos_validation.so) must be in the APK.": "",
|
||||
"Didn't finish ({value}): {error}": "",
|
||||
"Disable application space warp if used": "",
|
||||
"Disable controller tracking offset": "",
|
||||
@@ -338,11 +339,13 @@
|
||||
"Find automatically": "",
|
||||
"firewalld is active. Allow the setup port until the next restart with: sudo firewall-cmd --add-port={port}/tcp": "",
|
||||
"First-time setup": "",
|
||||
"Fix depth flicker (Unreal Vulkan)": "",
|
||||
"Fix launcher icon entry": "",
|
||||
"Fix minimal Android SDK": "",
|
||||
"Fix UE4 crash with Unity stub": "",
|
||||
"Fix upside-down menus": "",
|
||||
"Fixes graphics code that the Frame's drivers reject (black screen with sound).": "",
|
||||
"Fixes the black picture in Minecraft launchers (e.g. QuestCraft): uses depth formats the Frame's graphics driver accepts.": "",
|
||||
"Flat": "",
|
||||
"focus_hold hides focus dips up to this long (100-5000). Longer for a headset whose wear sensor flickers (\"HMD off\" for 0.5-2 s while worn, e.g. Blade & Sorcery pausing); taking the headset off or the system menu pauses the game only after this long.": "",
|
||||
"Folder": "",
|
||||
@@ -360,6 +363,8 @@
|
||||
"For mixed-reality-only games. On the Frame, passthrough is emulated by the FrameBridge adapter (greyscale cameras).": "",
|
||||
"For one eye looking wrong (e.g. a jittering right eye): logs each eye's submitted pose against a fresh one, the eye-to-eye relation and when each eye's image was released, also into framebridge.log in the game's storage (some games stop Android's log early). No effect on the game.": "",
|
||||
"For Unreal games that close themselves right after starting (e.g. Phantom: Covert Ops). Also disables the in-game Quit.": "",
|
||||
"For Unreal games whose models flicker or show through walls and windows on the Frame (e.g. Into The Radius 2). Needs a rebuild.": "",
|
||||
"For Vulkan games whose models flicker or vanish while you look at them (e.g. Into The Radius 2). Needs a rebuild.": "",
|
||||
"Force enable passthrough": "",
|
||||
"Found": "",
|
||||
"Frame agent": "",
|
||||
@@ -425,6 +430,7 @@
|
||||
"GL shim (Mesa GLSL compatibility)": "",
|
||||
"GL shim only: hide GL_OVR_multiview so all passes use single-view shaders. For GLES games whose multiview shaders fail on single-view render targets (e.g. Path of the Warrior).": "",
|
||||
"GL shim: hide multiview": "",
|
||||
"GL wrapper: OpenGL ES depth formats (Minecraft)": "",
|
||||
"Go to my library": "",
|
||||
"Go to System and turn on \"Enable Developer Mode\". A Developer page appears in Settings; nothing else changes, your games and data stay as they are.": "",
|
||||
"Graphics": "",
|
||||
@@ -571,6 +577,7 @@
|
||||
"Meta XR Audio: skip Quest telemetry class": "",
|
||||
"Meta's OVRManager switches Unity to the headset's recommended MSAA level (4x) while the game runs, whatever its quality settings say (log: \"Switching to the recommended level\"). Multisampled render-to-texture on GLES can hang the Frame's GPU, up to a restart of the whole headset (e.g. Lucky's Tale in a menu). Rewrites OVRDisplay.recommendedMSAALevel -> 0 in libil2cpp.so (found with Cpp2IL), so MSAA stays off.": "",
|
||||
"MiB": "",
|
||||
"Minecraft asks for desktop OpenGL's GL_DEPTH_COMPONENT32 depth textures. Some builds of LTW, the OpenGL-to-OpenGL ES wrapper in Minecraft launchers such as QuestCraft, pass that on unchanged; Quest's driver accepts it, the Frame's Mesa rejects it (GL_INVALID_OPERATION in glTexImage2D), so the depth buffer never exists and the picture stays black. LTW then loads OpenGL ES through a small shim that asks for GL_DEPTH_COMPONENT32F (or 24-bit) instead.": "",
|
||||
"Mirrored": "",
|
||||
"Mixed reality": "",
|
||||
"Mixed-reality games that build their level from your room get a simple room with walls.": "",
|
||||
@@ -654,6 +661,7 @@
|
||||
"Open GitHub issue": "",
|
||||
"OpenGL ES games run on the Frame through Zink (OpenGL on top of Vulkan), which is stricter than Quest drivers. Vulkan games run natively.": "",
|
||||
"Opens a prefilled GitHub issue with this game's recipe, so it can join the built-in catalog (no account token needed; you review and submit it on GitHub). No game files or personal data are sent.": "",
|
||||
"Opens the app straight in VR, skipping its flat launcher screen (turn off to use the launcher, e.g. to import new content).": "",
|
||||
"Opens this player's storage on the Frame (Files tab): upload videos into the folder it lists": "",
|
||||
"OpenXR runtime": "",
|
||||
"OR": "",
|
||||
@@ -891,6 +899,7 @@
|
||||
"Skips a Quest-only reporting step in Meta's audio library that crashes some games.": "",
|
||||
"Skips Meta XR Audio's telemetry under x86_64 ARM translation (emulators). Not needed on the Frame, which runs games natively.": "",
|
||||
"Sleep": "",
|
||||
"Some apps open a flat Android launcher that then starts a separate VR activity (e.g. WiiCompiled). Shown with Lepton's flat window, that window stays in view after the VR part starts. This makes the VR activity the one Lepton starts (its LAUNCHER category), so the app opens in VR with no flat window. Everything only the launcher does (choosing or importing content) is skipped: turn it off for a run when you need the launcher, and turn off \"Show the app's Android window\".": "",
|
||||
"Some engines leave the pNext of unused Vulkan attachment references uninitialized. The Frame's driver never reads it, but Lepton always loads Steam's Fossilize shader-cache layer, which follows it and crashes on the first frame (SIGSEGV in libVkLayer_fossilize.so from FVulkanRenderPass, e.g. Deadpool VR). Loads Vulkan through a small shim that keeps valid pointers and drops only unreadable ones or ones pointing at the wrong structure type.": "",
|
||||
"Some game folders are already set up for SteamVR: a Revive copy (LibRevive64.dll) next to the game, started by a small loader DLL (e.g. xinput1_3.dll) that Windows loads from the game's folder. Then FramePort starts the game program directly — like double-clicking it — instead of through its own Revive (two Revives conflict; e.g. the Oculus Platform check then fails). On the Frame, Wine is told to use those loader DLLs from the game folder instead of its own.": "",
|
||||
"Some games need a second build with different OVRPort patches (for some Unreal games: one with Unreal's ForceQuit removed). Turn this on to install that build instead.": "",
|
||||
@@ -900,6 +909,7 @@
|
||||
"Source": "",
|
||||
"square, 256 × 256": "",
|
||||
"Standard for every game": "",
|
||||
"Start straight in VR (skip the 2D launcher)": "",
|
||||
"Starting SteamVR and {title} — put your headset on": "",
|
||||
"Starting {title} on the Frame — put the headset on": "",
|
||||
"Starting {title}, but SteamVR isn't running — it may open as a flat window. Start SteamVR and relaunch.": "",
|
||||
@@ -920,6 +930,7 @@
|
||||
"steamos@frame.local or an IP address": "",
|
||||
"SteamVR": "",
|
||||
"Stereo (3D) 360° layers: 0 = as the game sends them, 2 = flat (the left image to both eyes).": "",
|
||||
"Stop objects popping in and out": "",
|
||||
"Stops Meta's audio library from reporting to Meta (only matters on PC emulators).": "",
|
||||
"Stops some Unreal games from closing themselves right after starting.": "",
|
||||
"Stops strict debugging checks that make some games quit.": "",
|
||||
@@ -1108,7 +1119,10 @@
|
||||
"VrApi → OpenXR adapter (OVRPort)": "",
|
||||
"VrApi → OpenXR bridge": "",
|
||||
"Vulkan shader fixes": "",
|
||||
"Vulkan shim (frame.vk_sanitize): makes two Unreal habits valid Vulkan - depth images get VK_IMAGE_USAGE_TRANSFER_DST_BIT (they are cleared with vkCmdClearDepthStencilImage) and Qualcomm shader-resolve subpasses lose an invalid depth resolve. Found with the validation layer in Into The Radius 2 (flickering models, windows behind models).": "",
|
||||
"Vulkan shim (frame.vk_sanitize): on gives every occlusion query room for both eyes. In multiview passes the Frame's driver writes a zero result for the second eye into the next query, so engines that count on one slot cull visible objects (models popping in and out, e.g. Into The Radius 2). 0 = off, 1 = on (2 slots).": "",
|
||||
"Vulkan shim (frame.vk_sanitize): SPIR-V modules matching size + SHA-256 get words inserted at a byte offset, e.g. stores that initialize locals a shader reads before writing (an undefined loop counter hung the GPU in VR4's campaign). Format: <size>:<sha256>:<byte offset>:<word>,<word>,...; several separated by ';'. Comes from a game's recipe.": "",
|
||||
"Vulkan shim: validation layer": "",
|
||||
"Vulkan: drop invalid render-pass pointers": "",
|
||||
"v{remote} (updates on the next action)": "",
|
||||
"Wait for the game's GPU before showing an image": "",
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
"""Depth formats for LTW, the GL-to-GLES wrapper of Minecraft launchers (QuestCraft): native/glshim/eglfmt.c."""
|
||||
from __future__ import annotations
|
||||
|
||||
from ...analysis import elf
|
||||
from ..base import ApkContext, Patch, Suggestion, register
|
||||
from . import artifact
|
||||
|
||||
LTW = "libltw.so"
|
||||
EGL = "libEGL.so"
|
||||
SHIM = "libfpg.so" # not longer than "libEGL.so": LTW's dlopen string is rewritten in place (.rodata only)
|
||||
|
||||
|
||||
class LtwDepthFormats(Patch):
|
||||
id = "frame.ltw_depth"
|
||||
needs_vr = False
|
||||
title = "GL wrapper: OpenGL ES depth formats (Minecraft)"
|
||||
description = ("Minecraft asks for desktop OpenGL's GL_DEPTH_COMPONENT32 depth textures. Some builds of LTW, the "
|
||||
"OpenGL-to-OpenGL ES wrapper in Minecraft launchers such as QuestCraft, pass that on unchanged; "
|
||||
"Quest's driver accepts it, the Frame's Mesa rejects it (GL_INVALID_OPERATION in glTexImage2D), so "
|
||||
"the depth buffer never exists and the picture stays black. LTW then loads OpenGL ES through a "
|
||||
"small shim that asks for GL_DEPTH_COMPONENT32F (or 24-bit) instead.")
|
||||
order = 74
|
||||
default_on = True
|
||||
|
||||
def applies(self, a):
|
||||
return LTW in a.libs
|
||||
|
||||
def detect(self, a):
|
||||
if self.applies(a):
|
||||
return Suggestion(True, "Ships LTW (Minecraft's OpenGL-to-OpenGL ES wrapper): Minecraft's 32-bit depth "
|
||||
"textures need the OpenGL ES format on the Frame (e.g. QuestCraft).")
|
||||
return None
|
||||
|
||||
def apply(self, ctx: ApkContext) -> bool:
|
||||
ws = ctx.ws
|
||||
if ws.abi != "arm64-v8a" or not ws.has(ws.lib(LTW)):
|
||||
return False
|
||||
data, count = elf.replace_rodata_string(ws.read_lib(LTW), EGL, SHIM)
|
||||
if not count:
|
||||
return False
|
||||
ws.put(ws.lib(LTW), data)
|
||||
ws.put(ws.lib(SHIM), artifact(ws.abi, SHIM))
|
||||
ctx.notes.append(f"{LTW} loads OpenGL ES through {SHIM}")
|
||||
return True
|
||||
|
||||
def validate(self, ctx: ApkContext):
|
||||
ws = ctx.ws
|
||||
if not ws.has(ws.lib(LTW)):
|
||||
return []
|
||||
uses = b"\0" + SHIM.encode() + b"\0" in ws.read_lib(LTW)
|
||||
return [("LTW loads the depth-format shim", uses and ws.has(ws.lib(SHIM)), SHIM)]
|
||||
|
||||
|
||||
register(LtwDepthFormats)
|
||||
@@ -2,7 +2,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from ...apk import axml
|
||||
from ..base import ApkContext, Patch, Suggestion, register
|
||||
from ..base import ApkContext, Param, Patch, Suggestion, register
|
||||
|
||||
MANIFEST = "AndroidManifest.xml"
|
||||
|
||||
@@ -96,6 +96,54 @@ class MetaPermissions(Patch):
|
||||
return bool(fixed)
|
||||
|
||||
|
||||
class StartActivity(Patch):
|
||||
id = "frame.start_activity"
|
||||
needs_vr = False
|
||||
title = "Start straight in VR (skip the 2D launcher)"
|
||||
description = ("Some apps open a flat Android launcher that then starts a separate VR activity (e.g. WiiCompiled). "
|
||||
"Shown with Lepton's flat window, that window stays in view after the VR part starts. This makes "
|
||||
"the VR activity the one Lepton starts (its LAUNCHER category), so the app opens in VR with no "
|
||||
"flat window. Everything only the launcher does (choosing or importing content) is skipped: turn "
|
||||
"it off for a run when you need the launcher, and turn off \"Show the app's Android window\".")
|
||||
order = 22
|
||||
params = [Param("activity", "str", "", "Activity to start (empty: the app's VR activity)")]
|
||||
|
||||
def applies(self, a):
|
||||
return bool((a.extra or {}).get("vr_activity"))
|
||||
|
||||
def detect(self, a):
|
||||
vr = (a.extra or {}).get("vr_activity")
|
||||
if not vr:
|
||||
return None
|
||||
return Suggestion(False, f"The app opens a 2D launcher; its VR part is {vr.rsplit('.', 1)[-1]}. Turn on to "
|
||||
"start that directly once the app is set up.")
|
||||
|
||||
def apply(self, ctx: ApkContext) -> bool:
|
||||
manifest = ctx.ws.read(MANIFEST)
|
||||
# the original APK's VR activity (analysis): after OVRPort's conversion every MAIN activity has the VR
|
||||
# category, so the converted manifest no longer tells them apart
|
||||
activity = ((ctx.params or {}).get("activity") or (ctx.analysis.extra or {}).get("vr_activity")
|
||||
or axml.vr_activity(manifest))
|
||||
if not activity:
|
||||
ctx.notes.append("no VR activity found")
|
||||
return False
|
||||
fixed = axml.set_start_activity(manifest, activity)
|
||||
if fixed:
|
||||
ctx.ws.put(MANIFEST, fixed)
|
||||
ctx.notes.append(f"starts {activity}")
|
||||
return bool(fixed)
|
||||
|
||||
def validate(self, ctx):
|
||||
manifest = ctx.ws.read(MANIFEST)
|
||||
names = axml.Axml(manifest).strings()
|
||||
starts = [n for el, n, items in axml.component_filters(manifest) if el in ("activity", "activity-alias")
|
||||
and any(k == "category" and names[i] == axml.LAUNCHER for k, _, i in items)]
|
||||
wanted = (ctx.params or {}).get("activity") or (ctx.analysis.extra or {}).get("vr_activity") or ""
|
||||
ok = len(starts) == 1 and wanted.rsplit(".", 1)[-1] == starts[0].rsplit(".", 1)[-1]
|
||||
return [("Only the VR activity is a launcher", ok, ", ".join(starts))]
|
||||
|
||||
|
||||
register(Launcher)
|
||||
register(NoDebuggable)
|
||||
register(MetaPermissions)
|
||||
register(StartActivity)
|
||||
@@ -119,14 +119,27 @@ SETTINGS = [
|
||||
"e.g. stores that initialize locals a shader reads before writing (an undefined loop counter hung the GPU in "
|
||||
"VR4's campaign). Format: <size>:<sha256>:<byte offset>:<word>,<word>,...; several separated by ';'. Comes from "
|
||||
"a game's recipe."),
|
||||
("vk_query_slots", "int", 0, "Vulkan shim: slots per occlusion query",
|
||||
"Vulkan shim (frame.vk_sanitize): on gives every occlusion query room for both eyes. In multiview passes the "
|
||||
"Frame's driver writes a zero result for the second eye into the next query, so engines that count on one slot "
|
||||
"cull visible objects (models popping in and out, e.g. Into The Radius 2). 0 = off, 1 = on (2 slots)."),
|
||||
("vk_spec_fixes", "int", 0, "Vulkan shim: depth spec fixes",
|
||||
"Vulkan shim (frame.vk_sanitize): makes two Unreal habits valid Vulkan - depth images get "
|
||||
"VK_IMAGE_USAGE_TRANSFER_DST_BIT (they are cleared with vkCmdClearDepthStencilImage) and Qualcomm shader-resolve "
|
||||
"subpasses lose an invalid depth resolve. Found with the validation layer in Into The Radius 2 (flickering "
|
||||
"models, windows behind models)."),
|
||||
("vk_validation", "int", 0, "Vulkan shim: validation layer",
|
||||
"Diagnostics: the Vulkan shim (frame.vk_sanitize) adds Khronos' validation layer to the game's instance; its "
|
||||
"findings go to launch.log. The layer library (libVkLayer_khronos_validation.so) must be in the APK."),
|
||||
("gl_hide_multiview", "int", 1, "GL shim: hide multiview",
|
||||
"GL shim only: hide GL_OVR_multiview so all passes use single-view shaders. For GLES games whose multiview "
|
||||
"shaders fail on single-view render targets (e.g. Path of the Warrior)."),
|
||||
]
|
||||
|
||||
|
||||
# settings that need a new build, not only new settings files: the Vulkan shim learned vk_shader_fix in 0.6.4
|
||||
REVISIONS = {"vk_shader_fix": 2}
|
||||
# settings that need a new build, not only new settings files: the Vulkan shim learned vk_shader_fix in 0.6.4 and
|
||||
# vk_query_slots in 0.9.2
|
||||
REVISIONS = {"vk_shader_fix": 2, "vk_query_slots": 3, "vk_spec_fixes": 2}
|
||||
|
||||
# How the "Game settings" dialog shows each setting to non-technical users: group, level (common settings are always
|
||||
# shown; advanced ones only under "Show advanced settings"), a plain label and one-line help, the control, and the
|
||||
@@ -147,6 +160,14 @@ UI: dict[str, dict] = {
|
||||
"focus_hold_ms": dict(group="screens", level="advanced", label="Ignore focus dips up to", depends="focus_hold",
|
||||
help="Longer for headsets that briefly think they're off your head.",
|
||||
control=("slider", 500.0, 3000.0, 100.0, "{:.0f} ms")),
|
||||
"vk_spec_fixes": dict(group="troubleshooting", level="advanced", label="Fix depth flicker (Unreal Vulkan)",
|
||||
help="For Unreal games whose models flicker or show through walls and windows on the Frame "
|
||||
"(e.g. Into The Radius 2). Needs a rebuild.",
|
||||
control=("switch",)),
|
||||
"vk_query_slots": dict(group="troubleshooting", level="advanced", label="Stop objects popping in and out",
|
||||
help="For Vulkan games whose models flicker or vanish while you look at them (e.g. Into "
|
||||
"The Radius 2). Needs a rebuild.",
|
||||
control=("switch",)),
|
||||
"sync_guard": dict(group="troubleshooting", level="advanced", label="Steady controller input after focus",
|
||||
help="For games that crash right after you return to them (e.g. after the Steam menu).",
|
||||
control=("switch",)),
|
||||
@@ -211,7 +232,7 @@ UI: dict[str, dict] = {
|
||||
control=("choice", [(0, "As the game sends it"), (2, "Flat")])),
|
||||
**{key: dict(group="troubleshooting", level="advanced", control=("switch",)) for key in (
|
||||
"foveation_fix", "hide_space_warp", "swapchain_fix", "layer_fix", "gl_hide_multiview", "mutable_fix",
|
||||
"flip_quads", "swap_eyes",
|
||||
"flip_quads", "swap_eyes", "vk_validation",
|
||||
"strip_depth", "respace_kick", "layer_debug", "eye_debug", "release_wait")},
|
||||
}
|
||||
|
||||
@@ -267,6 +288,9 @@ class AdapterSetting(Patch):
|
||||
"swapchain_fix": ap.is_gles,
|
||||
"gl_hide_multiview": lambda a: a.direct_vrapi and ap.is_gles(a),
|
||||
"vk_shader_fix": lambda a: a.engine == "Unreal", # read by the Vulkan shim, which only Unreal games get
|
||||
"vk_query_slots": lambda a: a.engine == "Unreal" and ap.is_vulkan(a),
|
||||
"vk_validation": lambda a: a.engine == "Unreal",
|
||||
"vk_spec_fixes": lambda a: a.engine == "Unreal" and ap.is_vulkan(a),
|
||||
"controller_models": ap.may_use_render_models,
|
||||
**{k: ap.is_gles for k in ("equirect_emul", "equirect_face", "equirect_res", "equirect_flip",
|
||||
"equirect_fps", "equirect_stereo")},
|
||||
|
||||
@@ -38,6 +38,10 @@ SUMMARIES = {
|
||||
"frame.adapter": "FramePort's translator between the game and the Steam Frame: fills in what the Frame lacks "
|
||||
"(controllers, room, passthrough). Needed for every converted game.",
|
||||
"frame.launcher": "Makes the game start from the Frame's Steam library.",
|
||||
"frame.start_activity": "Opens the app straight in VR, skipping its flat launcher screen (turn off to use the "
|
||||
"launcher, e.g. to import new content).",
|
||||
"frame.ltw_depth": "Fixes the black picture in Minecraft launchers (e.g. QuestCraft): uses depth formats the "
|
||||
"Frame's graphics driver accepts.",
|
||||
"frame.nodebug": "Stops strict debugging checks that make some games quit.",
|
||||
"frame.meta_permissions": "Declares Meta's permissions some mixed-reality games ask for, so they don't stop.",
|
||||
"frame.ovrplatformcompat": "Adds a small piece of Meta's platform library that some games need to start.",
|
||||
|
||||
@@ -114,8 +114,8 @@ class FramePortApp:
|
||||
ft.Container(expand=True),
|
||||
self.updater.card,
|
||||
self.activity_card,
|
||||
self.power_row,
|
||||
self.conn_card,
|
||||
self.power_row, # under the Frame card (owner's choice)
|
||||
], spacing=T.S2), width=T.px(236), bgcolor=T.SIDEBAR, padding=T.S4,
|
||||
border=ft.Border(right=ft.BorderSide(1, T.BORDER)))
|
||||
page.add(ft.Row([sidebar, self.body, self.activity.root], expand=True, spacing=0,
|
||||
|
||||
@@ -1305,3 +1305,13 @@ def test_proton_defaults_to_stable(monkeypatch, tmp_path):
|
||||
assert a.pick_proton([exp, stable])["name"] == "proton_11-arm64" # whatever the order
|
||||
assert a.pick_proton([stable, exp], "proton-experimental")["name"] == "proton-experimental-arm64" # by alias
|
||||
assert a.pick_proton([exp])["name"] == "proton-experimental-arm64" # only Experimental offered
|
||||
|
||||
|
||||
def test_launch_test_waits_for_a_first_boot(monkeypatch, tmp_path):
|
||||
"""The first start after an APK change: Lepton says "is not a running context" while it waits, then boots."""
|
||||
a = load_agent(monkeypatch, tmp_path)
|
||||
first = "Waiting for boot...\nERROR: 'steamlaunch-1' is not a running context, use 'lepton ps'\n"
|
||||
assert not a.not_started(first, 5) # still within the grace period
|
||||
assert a.not_started(first, 31) # no boot: the container really failed
|
||||
assert not a.not_started(first + "Boot complete!\nInstalling game.apk...\n", 120)
|
||||
assert not a.not_started("Boot complete!\n", 120)
|
||||
@@ -39,3 +39,40 @@ def test_edits_compose(quest_manifest):
|
||||
m, _ = axml.define_meta_permissions(m)
|
||||
assert axml.categories(m) == {axml.LAUNCHER}
|
||||
assert axml.Axml(m).get_bool("application", "debuggable") is False
|
||||
|
||||
|
||||
def _two_activity_manifest():
|
||||
"""WiiCompiled's shape: a 2D LauncherActivity (MAIN+LAUNCHER) and a QuestActivity (MAIN+VR+DEFAULT)."""
|
||||
from conftest import build_axml
|
||||
|
||||
def activity(name, cats):
|
||||
out = [("start", "activity", [("name", "str", name)]), ("start", "intent-filter", []),
|
||||
("start", "action", [("name", "str", "android.intent.action.MAIN")]), ("end", "action")]
|
||||
for c in cats:
|
||||
out += [("start", "category", [("name", "str", c)]), ("end", "category")]
|
||||
return out + [("end", "intent-filter"), ("end", "activity")]
|
||||
return build_axml([("start", "manifest", [("package", "str", "org.x.game")]), ("start", "application", []),
|
||||
*activity("org.x.game.launcher.LauncherActivity", [axml.LAUNCHER]),
|
||||
*activity("org.x.game.QuestActivity", [axml.VR_CATEGORY, axml.DEFAULT]),
|
||||
("end", "application"), ("end", "manifest")])
|
||||
|
||||
|
||||
def _filters(manifest):
|
||||
x = axml.Axml(manifest)
|
||||
names = x.strings()
|
||||
return {n.rsplit(".", 1)[-1]: sorted(names[i] for k, _, i in items if k == "category")
|
||||
for _, n, items in axml.component_filters(manifest)}
|
||||
|
||||
|
||||
def test_start_activity_moves_launcher_to_the_vr_activity():
|
||||
m = _two_activity_manifest()
|
||||
assert axml.vr_activity(m) == "org.x.game.QuestActivity"
|
||||
fixed = axml.set_start_activity(m, "QuestActivity")
|
||||
assert _filters(fixed) == {"LauncherActivity": [axml.INFO],
|
||||
"QuestActivity": sorted([axml.LAUNCHER, axml.DEFAULT])}
|
||||
assert axml.vr_activity(fixed) is None # the VR activity is the launcher now
|
||||
assert axml.set_start_activity(fixed, "QuestActivity") is None # nothing left to do
|
||||
assert axml.set_start_activity(m, "NoSuchActivity") is None
|
||||
# only those two attribute values changed: the rest parses as before
|
||||
assert axml.Axml(fixed).attr_str(next(e for e in axml.Axml(fixed).elements() if e.name == "manifest"),
|
||||
"package") == "org.x.game"
|
||||
@@ -484,3 +484,29 @@ def test_stand_ins_count_only_when_the_loader_links_them(monkeypatch):
|
||||
assert detect.missing_ovr_symbols(libs) == {"ovr_Room_GetNextRoomArrayPage"}
|
||||
linked[b"loader"] = ["libovrstubs.so"]
|
||||
assert detect.missing_ovr_symbols(libs) == set()
|
||||
|
||||
|
||||
def test_start_activity_after_overport_conversion(tmp_path):
|
||||
"""OVRPort gives every MAIN activity LAUNCHER + VR categories (WiiCompiled: LauncherActivity and QuestActivity),
|
||||
so the VR activity must come from the original APK's analysis; only it may stay a launcher."""
|
||||
from conftest import build_axml
|
||||
|
||||
from frameport.apk import axml
|
||||
|
||||
def activity(name):
|
||||
out = [("start", "activity", [("name", "str", name)]), ("start", "intent-filter", []),
|
||||
("start", "action", [("name", "str", axml.MAIN)]), ("end", "action")]
|
||||
for c in (axml.LAUNCHER, axml.VR_CATEGORY):
|
||||
out += [("start", "category", [("name", "str", c)]), ("end", "category")]
|
||||
return out + [("end", "intent-filter"), ("end", "activity")]
|
||||
manifest = build_axml([("start", "manifest", [("package", "str", "org.x.game")]),
|
||||
*activity("org.x.game.launcher.LauncherActivity"), *activity("org.x.game.QuestActivity"),
|
||||
("end", "manifest")])
|
||||
assert axml.vr_activity(manifest) is None # can't be told apart any more
|
||||
a = _analysis()
|
||||
a.extra = {**(a.extra or {}), "vr_activity": "org.x.game.QuestActivity"}
|
||||
patch = base.get("frame.start_activity")
|
||||
with ApkWorkspace(_apk(tmp_path, manifest)) as ws:
|
||||
ctx = base.ApkContext(ws, a, {}, Reporter(), {"frame.start_activity": {}})
|
||||
assert patch.apply(ctx)
|
||||
assert patch.validate(ctx) == [("Only the VR activity is a launcher", True, "org.x.game.QuestActivity")]
|
||||
Reference in new issue
Block a user