Files
DieMitchellandClaude Opus 5.5 853a32b0a4 Foveate the per-eye scene pass instead of wide stereo passes
Astro Bot draws its scene one eye at a time (1200x1280 at preset 5), so
the side-by-side gate never matched it and the map only reached other
wide passes. known_title now publishes the scene's eye size; exactly
that pass gets a single-eye map.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:48:01 +02:00

28 lines
1.0 KiB
C++

// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <cassert>
#include "core/vr/foveation_map.h"
int main() {
using namespace Core::Vr;
const Fov fov{1.0f, 1.0f, 1.0f, 1.0f};
GazeTarget gaze{0.25f, 0.75f, 0.5f, true};
const auto map = BuildFoveationMap(2048, 1024, 8, 8, fov, gaze);
assert(map.size() == 256 * 128);
assert(map[63 * 256 + 63] == 0);
assert(map[63 * 256 + 191] == 0);
assert(map[63 * 256 + 85] == 5);
assert(map[63 * 256] == 10);
const auto eye = BuildFoveationMap(1024, 1024, 8, 8, fov, gaze, false);
assert(eye.size() == 128 * 128);
assert(eye[63 * 128 + 63] == 0);
assert(eye[63 * 128 + 85] == 5);
assert(eye[63 * 128] == 10 && eye[63 * 128 + 127] == 10);
gaze.valid = false;
const auto fallback = BuildFoveationMap(2048, 1024, 8, 8, fov, gaze);
assert(fallback.front() == 0 && fallback.back() == 0);
assert(BuildFoveationMap(0, 1024, 8, 8, fov, gaze).empty());
}