feat(libSceVideoOut): validate ANYPS5_FULLSCREEN, restore the windowed size and hide the cursor in fullscreen #12930

Merged
MarcZX10 merged 30 commits from upstream-pr/12930 into main 2026-11-11 20:23:54 +00:00
MarcZX10 commented 2026-10-29 15:07:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T15:07:03Z.


What

F11 and ANYPS5_FULLSCREEN already exist on main (DisplayWindow::ToggleFullscreen, bound through InputControl::ToggleFullscreen). Gaps found and closed here:

  • ANYPS5_FULLSCREEN now has explicit spellings: 0/windowed and 1/borderless (unset and empty stay windowed). Any other non-empty value (true, yes, 2, ...) keeps its documented meaning, fullscreen, and prints a one-line warning on stderr naming the value. No value stops the game.
  • Leaving fullscreen now gives back the windowed size: HostFullscreenState remembers it on entering (or the creation size for a fullscreen start) and asks for it again only when the window did not return to it.
  • The host cursor is hidden while the window is fullscreen and no sceMouse handle is open (MouseIsOpen_nid_no_patch), shown again when a title opens one or fullscreen ends, and restored when the window is destroyed. It is only touched on a change.
  • The window operations sit behind IHostFullscreenWindow so the state machine runs without a display.

Teardown is safe for a partly built window (Destroy() guards the missing fullscreen state and never throws, a failed cursor restore is ignored).

Not offered: exclusive fullscreen (debt entry: not measured with the swapchain). ANYPS5_DISPLAY_INDEX is unchanged: the window is created centered on that display, and fullscreen goes to the display the window is on. No new key and no swapchain change: the existing surface-extent handling in VulkanDevice.cpp already covers a fullscreen transition.

Commits: parser, then its test; state machine, then its test; routing of DisplayWindow through it; cursor policy, its test, its wiring; docs (usage, environment, two debt entries, one each); window-level test on a real SDL window and its cursor check.

Overlaps with open PRs: none edit DisplayWindow.cpp except possibly through the shared files. #12569 and #12702 touch PadInput.cpp, KeyboardMouse.cpp and InputMapping (this PR touches none of them, and adds no key); #12536 touches VideoOutDriver.cpp and VulkanDevice.cpp (not touched here); #11948 touches VideoOutDriver.hpp and Output.cpp (not touched); all of them plus this PR edit core/libs/prx/libSceVideoOut/CMakeLists.txt, docs/dev/ENVIRONMENT.md, docs/user/USAGE.md and, for #11948, docs/dev/debt/libSceVideoOut.md, so expect trivial textual conflicts there.

Tested

Linux x86-64 (Debian, kernel 6.1), GCC via the repo's verify build.

  • New video_out_host_fullscreen (parser, toggle, size restore, adoption, refused transition, cursor policy over a fake window): pass.
  • New video_out_host_fullscreen_window (real SDL window: windowed, borderless, a legacy value, F11 in and out, windowed size back, SDL_ShowCursor state), configured with -DANYPS5_VIDEO_OUT_TEST_DRIVER=x11 under ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation xvfb-run -a ctest: pass. Under the default offscreen driver it skips (77) because that driver has no Vulkan window.
  • Existing video_out_flip_* (19) and video_out_telemetry*: branch 21/21 with the 2 new ones, baseline (upstream/main in a second tree) 19/19, same per-test results. VUID- lines: 0 on branch and baseline; the "layer not found" message: 0.
  • Negative controls (code broken in a scratch copy, new test fails at the intended case, restored): parser accepting anything (both tests fail), no size restore, cursor ignoring the mouse, adoption switching a fullscreen window again, Release always showing, DisplayWindow not parsing the variable (window test fails), DisplayWindow not refreshing the cursor (window test fails).
  • Not negative-controllable: the explicit size restore through a real window (Xvfb has no window manager, so SDL restores the size itself and a bypass of the state machine passes); only the fake window proves that call.
  • check_conventions.py --base upstream/main, git diff --check, public-headers audit, env_reference.py --check: clean.

NOT RUN: Windows, macOS, a desktop window manager or Wayland, a real display or hardware GPU (GPUs tested below is llvmpipe through Xvfb), multi-monitor use of ANYPS5_DISPLAY_INDEX with fullscreen, a game that opens a mouse.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: llvmpipe via Xvfb only (Xvfb has no window manager or compositor, so the claim that the existing surface-extent handling in VulkanDevice.cpp needs no swapchain change for a fullscreen toggle is unverified on a real driver and desktop session)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5070499994 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12930). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T15:07:03Z. --- ### What F11 and `ANYPS5_FULLSCREEN` already exist on main (`DisplayWindow::ToggleFullscreen`, bound through `InputControl::ToggleFullscreen`). Gaps found and closed here: - `ANYPS5_FULLSCREEN` now has explicit spellings: `0`/`windowed` and `1`/`borderless` (unset and empty stay windowed). Any other non-empty value (`true`, `yes`, `2`, ...) keeps its documented meaning, fullscreen, and prints a one-line warning on stderr naming the value. No value stops the game. - Leaving fullscreen now gives back the windowed size: `HostFullscreenState` remembers it on entering (or the creation size for a fullscreen start) and asks for it again only when the window did not return to it. - The host cursor is hidden while the window is fullscreen and no sceMouse handle is open (`MouseIsOpen_nid_no_patch`), shown again when a title opens one or fullscreen ends, and restored when the window is destroyed. It is only touched on a change. - The window operations sit behind `IHostFullscreenWindow` so the state machine runs without a display. Teardown is safe for a partly built window (`Destroy()` guards the missing fullscreen state and never throws, a failed cursor restore is ignored). Not offered: exclusive fullscreen (debt entry: not measured with the swapchain). `ANYPS5_DISPLAY_INDEX` is unchanged: the window is created centered on that display, and fullscreen goes to the display the window is on. No new key and no swapchain change: the existing surface-extent handling in `VulkanDevice.cpp` already covers a fullscreen transition. Commits: parser, then its test; state machine, then its test; routing of `DisplayWindow` through it; cursor policy, its test, its wiring; docs (usage, environment, two debt entries, one each); window-level test on a real SDL window and its cursor check. Overlaps with open PRs: none edit `DisplayWindow.cpp` except possibly through the shared files. #12569 and #12702 touch `PadInput.cpp`, `KeyboardMouse.cpp` and `InputMapping` (this PR touches none of them, and adds no key); #12536 touches `VideoOutDriver.cpp` and `VulkanDevice.cpp` (not touched here); #11948 touches `VideoOutDriver.hpp` and `Output.cpp` (not touched); all of them plus this PR edit `core/libs/prx/libSceVideoOut/CMakeLists.txt`, `docs/dev/ENVIRONMENT.md`, `docs/user/USAGE.md` and, for #11948, `docs/dev/debt/libSceVideoOut.md`, so expect trivial textual conflicts there. ### Tested Linux x86-64 (Debian, kernel 6.1), GCC via the repo's verify build. - New `video_out_host_fullscreen` (parser, toggle, size restore, adoption, refused transition, cursor policy over a fake window): pass. - New `video_out_host_fullscreen_window` (real SDL window: windowed, borderless, a legacy value, F11 in and out, windowed size back, `SDL_ShowCursor` state), configured with `-DANYPS5_VIDEO_OUT_TEST_DRIVER=x11` under `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation xvfb-run -a ctest`: pass. Under the default `offscreen` driver it skips (77) because that driver has no Vulkan window. - Existing `video_out_flip_*` (19) and `video_out_telemetry*`: branch 21/21 with the 2 new ones, baseline (upstream/main in a second tree) 19/19, same per-test results. VUID- lines: 0 on branch and baseline; the "layer not found" message: 0. - Negative controls (code broken in a scratch copy, new test fails at the intended case, restored): parser accepting anything (both tests fail), no size restore, cursor ignoring the mouse, adoption switching a fullscreen window again, Release always showing, `DisplayWindow` not parsing the variable (window test fails), `DisplayWindow` not refreshing the cursor (window test fails). - Not negative-controllable: the explicit size restore through a real window (Xvfb has no window manager, so SDL restores the size itself and a bypass of the state machine passes); only the fake window proves that call. - `check_conventions.py --base upstream/main`, `git diff --check`, public-headers audit, `env_reference.py --check`: clean. NOT RUN: Windows, macOS, a desktop window manager or Wayland, a real display or hardware GPU (GPUs tested below is llvmpipe through Xvfb), multi-monitor use of `ANYPS5_DISPLAY_INDEX` with fullscreen, a game that opens a mouse. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: llvmpipe via Xvfb only (Xvfb has no window manager or compositor, so the claim that the existing surface-extent handling in `VulkanDevice.cpp` needs no swapchain change for a fullscreen toggle is unverified on a real driver and desktop session) - [x] AI-assisted: yes
CnRJay commented 2026-10-29 18:54:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-29T18:54:27Z.

Review: COMMENTED


The state machine and the parser are in good shape, and oneandonlydean's points are addressed. One thing is not covered by any of the runs listed.

The swapchain path is untested on a real GPU. The description says the existing surface-extent handling in VulkanDevice.cpp "already covers a fullscreen transition", but every run is llvmpipe on Xvfb, which has no window manager. There is no compositor, no real present mode and no extent change at all. On a real driver a borderless toggle changes the surface extent, and the present then returns VK_SUBOPTIMAL_KHR or VK_ERROR_OUT_OF_DATE_KHR. The title can be in the middle of a flip when that happens, and the recreate drains the queue.

Please run F11 in and out on a real GPU and desktop session (Windows or Wayland/X11 with a WM) with VK_LAYER_KHRONOS_validation, and report two things:

  • no VUID- lines, in particular for swapchain image extents after the toggle;
  • the number of recreates per toggle and the frame time across the toggle from tools/trace_digest.py.

Without that, GPUs tested: llvmpipe via Xvfb only should state that the claim "no swapchain change needed" is unverified, because a missing recreate shows up as a stretched or frozen image rather than a test failure.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5703312756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12930#pullrequestreview-5703312756). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-29T18:54:27Z. **Review:** COMMENTED --- The state machine and the parser are in good shape, and oneandonlydean's points are addressed. One thing is not covered by any of the runs listed. **The swapchain path is untested on a real GPU.** The description says the existing surface-extent handling in `VulkanDevice.cpp` "already covers a fullscreen transition", but every run is llvmpipe on Xvfb, which has no window manager. There is no compositor, no real present mode and no extent change at all. On a real driver a borderless toggle changes the surface extent, and the present then returns `VK_SUBOPTIMAL_KHR` or `VK_ERROR_OUT_OF_DATE_KHR`. The title can be in the middle of a flip when that happens, and the recreate drains the queue. Please run F11 in and out on a real GPU and desktop session (Windows or Wayland/X11 with a WM) with `VK_LAYER_KHRONOS_validation`, and report two things: - no `VUID-` lines, in particular for swapchain image extents after the toggle; - the number of recreates per toggle and the frame time across the toggle from `tools/trace_digest.py`. Without that, `GPUs tested: llvmpipe via Xvfb only` should state that the claim "no swapchain change needed" is unverified, because a missing recreate shows up as a stretched or frozen image rather than a test failure.
MarcZX10 commented 2026-11-02 04:58:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:58:15Z.

Review: COMMENTED


Reviewed — Windows display run still missing; hosted Windows check skipped the window test

oneandonlydean asks for a Windows run of video_out_host_fullscreen_window with a display required; the hosted Windows job at this head skipped that test and did not set the variable that makes a missing display fail.

What I ran

Live head: 140a77e430fca41a8dd6e1d59b54915526a61b0d (OPEN, same as the batch file). Read the comments and reviews with gh api. Read files with git -C /marc/AnyPS5 show 140a77e4…:<path>. Read the Windows job log via gh api (job 124782472623, run 41284117161). Read the hosted check rollup with gh pr view. Nothing was built or run.

Results

Check Result Note
windows SUCCESS run 41284117161; 2581 ctest, 0 failed; video_out_host_fullscreen_window Skipped
conventions, library-portability SUCCESS hosted, at this head

Findings

  • oneandonlydean, 2026-11-01 09:56 UTC: attach a Windows run of video_out_host_fullscreen_window with the display required, and record OS, SDL and Vulkan. Confirmed missing. The window test is registered at CMakeLists.txt L112-L113 and exits 77 (skip) when no display is present. DisplayRequired() reads ANYPS5_REQUIRE_DISPLAY or ANYPS5_REQUIRE_VULKAN (HostFullscreen.cpp L205-L207). The hosted Windows job log shows the window test Skipped and neither variable set.
  • The env helper change the reviewer accepted: _putenv_s on Windows and a readback check are at HostFullscreen.cpp L303-L311.
  • The PR body (line 26) still lists Windows and a real display as NOT RUN.

Sources

Not verified

  • The reviewer's requested run itself: not done here, and I cannot run it.
  • Whether a real Windows desktop with SDL and Vulkan passes the test: unknown.
  • Nothing was built or run here.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732253761 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12930#pullrequestreview-5732253761). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:58:15Z. **Review:** COMMENTED --- # Reviewed — Windows display run still missing; hosted Windows check skipped the window test oneandonlydean asks for a Windows run of `video_out_host_fullscreen_window` with a display required; the hosted Windows job at this head skipped that test and did not set the variable that makes a missing display fail. ## What I ran Live head: 140a77e430fca41a8dd6e1d59b54915526a61b0d (OPEN, same as the batch file). Read the comments and reviews with `gh api`. Read files with `git -C /marc/AnyPS5 show 140a77e4…:<path>`. Read the Windows job log via `gh api` (job 124782472623, run 41284117161). Read the hosted check rollup with `gh pr view`. Nothing was built or run. ## Results | Check | Result | Note | |---|---|---| | windows | SUCCESS | run 41284117161; 2581 ctest, 0 failed; `video_out_host_fullscreen_window` Skipped | | conventions, library-portability | SUCCESS | hosted, at this head | ## Findings - oneandonlydean, 2026-11-01 09:56 UTC: attach a Windows run of `video_out_host_fullscreen_window` with the display required, and record OS, SDL and Vulkan. Confirmed missing. The window test is registered at CMakeLists.txt L112-L113 and exits 77 (skip) when no display is present. `DisplayRequired()` reads `ANYPS5_REQUIRE_DISPLAY` or `ANYPS5_REQUIRE_VULKAN` (HostFullscreen.cpp L205-L207). The hosted Windows job log shows the window test Skipped and neither variable set. - The env helper change the reviewer accepted: `_putenv_s` on Windows and a readback check are at HostFullscreen.cpp L303-L311. - The PR body (line 26) still lists Windows and a real display as NOT RUN. ## Sources - https://github.com/boykopovar/AnyPS5/blob/140a77e430fca41a8dd6e1d59b54915526a61b0d/core/libs/prx/libSceVideoOut/CMakeLists.txt#L112-L113 - https://github.com/boykopovar/AnyPS5/blob/140a77e430fca41a8dd6e1d59b54915526a61b0d/core/libs/prx/libSceVideoOut/tests/HostFullscreen.cpp#L205-L207 - https://github.com/boykopovar/AnyPS5/blob/140a77e430fca41a8dd6e1d59b54915526a61b0d/core/libs/prx/libSceVideoOut/tests/HostFullscreen.cpp#L303-L311 ## Not verified - The reviewer's requested run itself: not done here, and I cannot run it. - Whether a real Windows desktop with SDL and Vulkan passes the test: unknown. - Nothing was built or run here.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12930
No description provided.