Skip to content

psvr2: initialize fallback distortion rotation scales#3

Open
DMJC wants to merge 1 commit intomainfrom
codex/check-right-eye-drawing-logic
Open

psvr2: initialize fallback distortion rotation scales#3
DMJC wants to merge 1 commit intomainfrom
codex/check-right-eye-drawing-logic

Conversation

@DMJC
Copy link
Copy Markdown
Owner

@DMJC DMJC commented Feb 15, 2026

Motivation

  • Older PSVR2 firmware path left the per-eye rotation/tilt basis terms unset which caused the distortion transform basis (k3/k4) to be zero and could collapse UV sampling and make one eye render incorrectly compared to the other.

Description

  • When calibration_block.version_unk < 4, initialize hmd->distortion_calibration[4] and hmd->distortion_calibration[6] to 1.0f so the rotation/tilt scale is the identity for both eyes.
  • The existing memset leaves the sine (tilt) terms at zero, so this change produces an identity rotation (cos = 1, sin = 0) for fallback cases.
  • This ensures psvr2_compute_distortion_asymmetric receives valid k3/k4 values and prevents UV collapse around the lens center.

Testing

  • Reviewed the distortion code paths in psvr2_setup_distortion_and_fovs and psvr2_compute_distortion_asymmetric by source inspection and confirmed the new values flow into the distortion computation (inspection succeeded).
  • Attempted to enumerate build targets with ninja -C build -t targets but the command failed due to a missing build/build.ninja in the workspace (build-target enumeration failed).
  • No automated unit or integration tests were available or executed in this environment.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant