Repository navigation
fix(rendering): stop foveation enable call from overriding the selected level (#41) - #226
Conversation
…ed level (#41) VRActivity.onCreate and the Settings foveation selector called nativeSetFoveationEnabled(mode != 0) right after nativeSetFoveationMode(mode). The bridge's set_foveation_enabled maps "enabled" to mode 4 (Auto), so a persisted or selected Low/Medium/High was always replaced by Auto, and the render loop applied the QualityController level (1) instead. set_foveation_mode already updates FOVEATION_ENABLED, so the second call is dropped. Verified on Quest 3: saved modes 2 and 3 now log "Foveated Rendering: aplicado nivel=2/3" (before: nivel=1). Refs #41 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DKhrqR6co7AR9tP6fh6G2n
The receiver reads EXTRA_SCREEN_MODE ("screen_mode"); the checklist command
and the VRActivity comment passed "mode", which the broadcast ignores.
Refs #46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKhrqR6co7AR9tP6fh6G2n
BGLuis
left a comment
There was a problem hiding this comment.
Clean and precise fix for the foveation mode override bug observed during Quest 3 hardware validation (#41), along with the documentation fix for SET_SCREEN_MODE (#46).
Removing nativeSetFoveationEnabled from both startup (VRActivity.onCreate) and SettingsScreen stops set_foveation_enabled (rust/bridge/src/lib.rs:258) from overwriting granular modes (1=Low, 2=Medium, 3=High) to mode 4 (Auto). Since set_foveation_mode already updates FOVEATION_ENABLED via FOVEATION_ENABLED.store(mode != 0), the boolean toggle state and stats remain coherent.
Fixing --ei mode 6 to --ei screen_mode 6 aligns the checklist with VRActivity.EXTRA_SCREEN_MODE and docs/DEBUGGING.md, where the broadcast was previously a no-op.
Suggestion
- Consider annotating the now-unused declaration
external fun nativeSetFoveationEnabledinVRActivity.ktwith@Deprecatedto warn future callers that invoking it resets mode to Auto (inline onVRActivity.kt:488).
Dependencies: No package version or lockfile changed (dependency_diff.py). No new library APIs called. Dual-backend and JNI layering conventions (ADR-002) respected.
Checked: rust/bridge/src/lib.rs, native/src/vr_player_app_vulkan.cpp, VRActivity.kt, SettingsScreen.kt, HARDWARE-VALIDATION-CHECKLIST.md, DEBUGGING.md, issues #41 and #46, and git diff. Ran: ./gradlew ktlintCheck, ./gradlew testDebugUnitTest, npx --yes markdownlint-cli2@0.18.1, cargo test -p protocols -p media-logic (all passed). Not run: Physical Quest 3 headset validation in this CI session (author verified on Quest 3 firmware UP1A.231005.007.A1 and provided logs in the PR description).
Description
Found while running the #34 hardware-validation blocks on a Quest 3: the 5-level foveation matrix in #41 could not be validated because Low/Medium/High were always replaced by Auto.
VRActivity.onCreateand the Settings foveation selector callednativeSetFoveationEnabled(mode != 0)right afternativeSetFoveationMode(mode).set_foveation_enabled(rust/bridge/src/lib.rs:257-259) maps "enabled" to mode 4 (Auto), so any fixed level was overwritten and the render loop applied theQualityControllerlevel (1).set_foveation_modealready updatesFOVEATION_ENABLED, so the second call is dropped. The GLES path also exportsnativeSetFoveationModeand only readsget_foveation_enabled(), so both back-ends are covered.A second commit fixes the
SET_SCREEN_MODEexample indocs/HARDWARE-VALIDATION-CHECKLIST.md(Block 6, #46) and in aVRActivitycomment: the receiver reads thescreen_modeextra, notmode, so the documented command did nothing.Refs #41, #46 (does not close them: the validation sessions are still pending).
Left as is:
nativeSetFoveationEnabled/set_foveation_enablednow have no Kotlin caller. They are kept to avoid touching the frozen GLES path, but calling them again would reintroduce the bug.Type of change
Affected layers
app/) — app shell, UI panels, credentials, history, i18nHow has this been tested?
cargo test):./gradlew testDebugUnitTestand./gradlew ktlintCheckpass../gradlew assembleDebug, Vulkan).UP1A.231005.007.A1): the persistedfoveated_rendering_modewas set through prefs, the app was restarted on a 4K clip in Cinema, and the native log was read.aplicado nivel=1aplicado nivel=1aplicado nivel=1aplicado nivel=2aplicado nivel=1aplicado nivel=3aplicado nivel=1aplicado nivel=1(Auto start level)Not tested: changing the level from the Settings UI during playback. It takes the same code path, but tapping the UI needs someone wearing the headset; that is part of the #41 manual session. The telemetry CSV
foveationcolumn is a boolean (foveationEnabled), so the level must be checked in logcat, not in the CSV.Checklist:
clippy -D warnings).If applicable
🤖 Generated with Claude Code
https://claude.ai/code/session_01DKhrqR6co7AR9tP6fh6G2n