Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/frame-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Steam Frame release
# Publishes a GitHub pre-release with the notes in docs/releases/<tag>.md, either for a pushed
# frame-<something> tag or, run by hand (Actions > Steam Frame release > Run workflow), for a tag
# GitHub creates on the commit the run is for. Source only: the game is built from the player's own
# disc and nothing built from it is distributed (README, Requirements). The v* tags stay with
# package.yml, which packages upstream's Windows installer.
on:
push:
tags: ['frame-*']
workflow_dispatch:
inputs:
tag:
description: Release tag, frame-<something>; docs/releases/<tag>.md holds its notes
required: true
default: frame-beta-1
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Publish the pre-release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
REPOSITORY: ${{ github.repository }}
DISPATCHED: ${{ github.event_name == 'workflow_dispatch' }}
run: |
case "$TAG" in
frame-*) ;;
*) echo "::error::Steam Frame release tags start with frame-, not '$TAG'"; exit 1 ;;
esac
notes="docs/releases/${TAG}.md"
if [ ! -f "$notes" ]; then
echo "::error::No release notes at $notes"
exit 1
fi
if [ "$DISPATCHED" = "true" ]; then
# GitHub creates the tag on this run's commit.
where=(--target "$GITHUB_SHA")
else
where=(--verify-tag)
fi
gh release create "$TAG" --repo "$REPOSITORY" "${where[@]}" --prerelease \
--title "WiiCompiled VR for the Steam Frame ${TAG#frame-}" --notes-file "$notes"
2 changes: 1 addition & 1 deletion Launcher/Test-Recompilation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ foreach ($relative in $sourceFiles | Sort-Object -Unique) {
# Keep this list explicit: a new unresolved guest dependency must fail the test.
[uint32]$entry = 0x80001000L
[uint32[]]$guestCallbacks = @(
0x8012B830L, 0x801A0620L, 0x801A1ED8L, 0x801A961CL,
0x801284B4L, 0x8012B830L, 0x801A0620L, 0x801A1ED8L, 0x801A961CL,
0x801AADE0L, 0x801D8D30L, 0x801D9E94L, 0x8055531CL,
0x8056A470L, 0x8056A580L, 0x805A6C58L
)
Expand Down
10 changes: 8 additions & 2 deletions OPENXR.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ mirror_view = "normal"
controller_mode = "wii_remote"
frame_interpolation_fps = 0
refresh_rate = 0
repeat_frames = false
render_scale = 1.0
world_units_per_meter = 500.0
hud_distance_meters = 2.0
Expand Down Expand Up @@ -231,6 +232,10 @@ Frame) to leave the headset's own. The game renders 60 frames a second, so 120 H
for exactly two refreshes. A rate the runtime does not list, or declines, is logged and leaves its
own; setting `0` again restores the rate the session started at. It is live from F10 / the headset
panel (*Headset refresh rate*) and the Quest launcher; runtimes without the extension ignore it.
`repeat_frames` (default off, on for the Steam Frame) submits the last frame again, with the poses it
was rendered for, on each refresh the game has no new frame for, so a runtime sees the app at the
display's rate and does not halve it and fill refreshes itself (SteamVR on the Frame did, doubling the
HUD while the head turned). Render-first pacing only; live from F10 / the headset panel.

## Controllers

Expand Down Expand Up @@ -1088,8 +1093,9 @@ did (39 to 41.5 FPS).
With `eye_tracked_foveation`, a runtime that offers `XR_EXT_eye_gaze_interaction` and reports an eye
tracker (the Steam Frame's SteamVR) has its gaze pose located for each packet's display time and
turned into tangents of each eye's view (`vr/eye_gaze.h`), which `AuroraStereoFrame` carries as
`gaze`/`gazeValid`. Aurora centres the level's rings on the gaze snapped to a cell of two map texels
(about 3 degrees), keeping up to 32 maps per eye, one per cell looked at, and binds a new one once
`gaze`/`gazeValid`. Aurora centres the level's rings, each widened by 8 degrees to cover the lag
and error of tracking, on the gaze snapped to a cell of two map texels (about 3 degrees), keeping up
to 128 maps per eye, one per cell looked at, and binds a new one once
its upload completes, the previous map staying bound meanwhile. Without a tracked gaze (a blink, no
tracker, the setting off) the map is the forward one above, unchanged. Details and the Steam Frame
checks are in `docs/steam-frame.md`.
Expand Down
400 changes: 172 additions & 228 deletions README.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion aurora-main/cmake/AuroraDawnProvider.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ elseif (_aurora_dawn_provider STREQUAL "package")
endif ()
endif ()
endif ()
message(STATUS "aurora: Fetching prebuilt Dawn package from ${AURORA_DAWN_PACKAGE_URL}")
if (FETCHCONTENT_SOURCE_DIR_DAWN_PREBUILT)
message(STATUS "aurora: Using the local Dawn package ${FETCHCONTENT_SOURCE_DIR_DAWN_PREBUILT}")
else ()
message(STATUS "aurora: Fetching prebuilt Dawn package from ${AURORA_DAWN_PACKAGE_URL}")
endif ()

set(_dawn_prebuilt_hash_argument "")
if (AURORA_DAWN_PACKAGE_URL_HASH)
Expand Down
5 changes: 3 additions & 2 deletions aurora-main/lib/aurora.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,9 @@ struct EyeDensityMap {
uint64_t map = 0;
uint64_t lastUse = 0;
};
// The gaze cells' maps an eye keeps: a few glances' worth, each 2 bytes per 32x32 pixels.
constexpr size_t kEyeDensityMapCacheSize = 32;
// The gaze cells' maps an eye keeps, each 2 bytes per 32x32 pixels in a memory block of its own:
// most of the cells a session's glances reach, so a glance rarely waits for a map to upload.
constexpr size_t kEyeDensityMapCacheSize = 128;

struct StereoEyeTarget {
webgpu::TextureWithSampler color;
Expand Down
15 changes: 12 additions & 3 deletions aurora-main/lib/gfx/foveation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,16 @@ inline Gaze cell_gaze(uint32_t eyeWidth, uint32_t eyeHeight, uint32_t texel, con
.tanY = fov.tanUp + (fov.tanDown - fov.tanUp) * v};
}

inline uint8_t density(Level level, float eccentricity) noexcept {
const Rings ring = rings(level);
// Eye-tracked maps widen both rings by this much. The full-density region has to cover where the eye
// lands after a saccade until the next game frame's map is bound, the tracker's error, and the
// snapping of the gaze to cells and of the density to the driver's tiles (Turnip shades a whole
// render-pass bin at one density).
inline constexpr float kTrackedMarginDegrees = 8.0f;

inline uint8_t density(Level level, float eccentricity, float margin = 0.0f) noexcept {
Rings ring = rings(level);
ring.full += margin;
ring.half += margin;
if (eccentricity < ring.full) {
return kFullDensity;
}
Expand Down Expand Up @@ -176,7 +184,8 @@ inline void build(uint32_t eyeWidth, uint32_t eyeHeight, uint32_t texel, const E
static_cast<float>(eyeWidth);
const float tanX = fov.tanLeft + (fov.tanRight - fov.tanLeft) * u;
const uint8_t value =
density(level, forward ? eccentricity_degrees(tanX, tanY) : angle_from_gaze_degrees(tanX, tanY, gaze));
forward ? density(level, eccentricity_degrees(tanX, tanY))
: density(level, angle_from_gaze_degrees(tanX, tanY, gaze), kTrackedMarginDegrees);
uint8_t* texelBytes = &map.rg8[(static_cast<size_t>(y) * map.width + x) * 2];
texelBytes[0] = value;
texelBytes[1] = value;
Expand Down
8 changes: 6 additions & 2 deletions aurora-main/patches/dawn/aurora_fdm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ MaybeError AuroraFdmUpload(Device* device, uint32_t width, uint32_t height, cons

VkMemoryRequirements requirements;
device->fn.GetImageMemoryRequirements(device->GetVkDevice(), map.image, &requirements);
DAWN_TRY_ASSIGN(map.memory,
device->GetResourceMemoryAllocator()->Allocate(requirements, MemoryKind::DeviceLocal));
// A memory block of its own. Turnip reads a map through a host mapping of its memory, taken
// when the image is bound, and Dawn's buffer uploads map and unmap the shared blocks they
// sub-allocate from (Buffer::MapMemoryAndPerformOperation). An unmap there pulled the mapping
// from under a map sharing the block, and the next render pass read freed memory.
DAWN_TRY_ASSIGN(map.memory, device->GetResourceMemoryAllocator()->Allocate(
requirements, MemoryKind::DeviceLocal, /*forceDisableSubAllocation=*/true));
DAWN_TRY(CheckVkSuccess(device->fn.BindImageMemory(device->GetVkDevice(), map.image,
ToBackend(map.memory.GetResourceHeap())->GetMemory(),
map.memory.GetOffset()),
Expand Down
5 changes: 3 additions & 2 deletions aurora-main/tests/foveation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ TEST(Foveation, TheForwardGazeKeepsTheFixedMap) {

TEST(Foveation, TheFullDensityRegionFollowsTheGaze) {
const EyeFov fov = left_eye();
// Down and to the right, well off the forward direction.
const Gaze gaze{.tanX = std::tan(20.0f * kDegrees), .tanY = std::tan(-15.0f * kDegrees)};
// Down and to the right, off the forward direction, with the widened full-density region still
// inside the eye so its centre is not pulled in by the edge.
const Gaze gaze{.tanX = std::tan(12.0f * kDegrees), .tanY = std::tan(-10.0f * kDegrees)};
Map map;
foveation::build(1344, 1408, 32, fov, Level::High, map, gaze);
double sumX = 0.0;
Expand Down
43 changes: 43 additions & 0 deletions docs/releases/frame-beta-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
The first beta of WiiCompiled VR for the Steam Frame: Mario Kart Wii, statically recompiled to native
ARM64 code, running in VR on SteamOS through SteamVR.

**This release is source only.** The game is always built from your own clean PAL `RMCP01` disc,
and nothing built from it may be distributed, so there is no ready-built game here. Follow
[Building and installing](https://github.com/mitch030504/Wiicompiled_VR_Frame#building-and-installing)
in the README; the full commands are in
[`docs/steam-frame.md`](https://github.com/mitch030504/Wiicompiled_VR_Frame/blob/frame-beta-1/docs/steam-frame.md).

## What works on the Frame

- Starts in VR from the Steam library (installed with Frame Control) with SteamVR's OpenXR runtime.
The runtime creates the GPU device the game renders with, so the eyes go straight into the
headset's swapchain.
- Both eyes at the panels' native 2160x2160 (`render_scale = 1.25`), 120 Hz, every game frame
shown: SteamVR reports 120 Hz with 60 new frames and 60 repeats a second and no late frames.
- The Frame's own controllers: left D-pad as the Wii Remote's D-pad, View to pause, left shoulder
for the settings panel.
- Fragment density map foveation that follows your eyes through the Frame's eye tracking.

## Fixed during device testing

- A crash on race restart inside the Frame's Vulkan driver: density maps shared memory that Dawn
unmaps after buffer uploads. Each map now has its own memory block (Dawn patch, so rebuild Dawn).
- SteamVR halving the game's rate and filling every other refresh itself:
`[vr] repeat_frames` (on by default for the Frame) resubmits the last frame for those refreshes.
- Native crashes on Linux now log the faulting thread, pc and backtrace.
- The eye-tracked foveation region is 8 degrees wider and each eye keeps 128 maps.

## Known issues

- Images double in races and on the HUD, sometimes in the right eye only. Foveation is the main
suspect; try foveation Off if it bothers you, and report the result.
- Foveation follows the right eye less well than the left.
- VR frame interpolation is not recommended on the Frame.
- The Android (`steamFrame`) flavour cannot show a picture in Lepton; use the native build.

## Recommended settings

`render_scale = 1.25`, `foveation = "medium"`, `repeat_frames = true`, `frame_interpolation_fps = 0`
under `[vr]`, and `resolution_multiplier = 2` under `[video]`. SteamVR at 120 Hz.

Reports with the run log from `~/.local/share/WiiCompiled/Logs/` are welcome as issues.
Loading
Loading