fix(libSceVideodec2): answer the generic picture query for VP9 pictures #8839

Merged
JJenkx merged 1 commit from upstream-pr/8839 into main 2026-10-21 08:32:05 +00:00
JJenkx commented 2026-10-21 02:11:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T02:11:43Z.


What

Mortal Shell 2 (PPSA34008) plays its intro movie through a VP9 Videodec2 decoder ([videodec2] decoder 1: codec=2382845 max 3840x2160) and asks for each picture's metadata with the generic sceVideodec2GetPictureInfo (NtXRa3dRzU0), not sceVideodec2GetVp9PictureInfo. On main the generic query throws for anything but H.264, and the title aborts 88.7 s in:

what():  Videodec2: picture info is only implemented for H.264

A gdb breakpoint on the export shows the call: output thisSize=56 pictureCount=1 first thisSize=88 second=nullptr. 88 bytes is sizeof(Vp9PictureInfo).

sceVideodec2GetPictureInfo now writes the decoder's own layout for a VP9 picture: the same 88-byte VP9 structure sceVideodec2GetVp9PictureInfo returns, checked against thisSize. shadPS4's videodec2.cpp handles the generic query the same way, copying the decoder's own picture-info layout sized by the caller's thisSize. H.264 is unchanged. HEVC pictures still throw: no title calling the HEVC layout has been seen (as when #2161 was closed).

Tested

Windows 11 22621, AMD Radeon RX 6700 XT, WinLibs GCC 15.2 UCRT r7, Release, on main 6c12024f7.

  • guest_videodec2: the VP9 clip now also calls the generic query with a guarded 88-byte structure and checks that every field equals sceVideodec2GetVp9PictureInfo's result and that the guard after it is intact. It fails without the library change (Videodec2: picture info is only implemented for H.264) and passes with it.
  • Full ctest -j 32: 1817 of 1819 pass. The other two fail the same way on main: agc_driver_image_array_window_past_layer_limit (does not build on MinGW, #8310/#8361) and agc_driver_tessellation (reported on #6679).
  • PPSA34008, same run directory and scene, two complete library sets built from 6c12024f7 that differ only in libSceVideodec2.prx; both runs used APS5_LOOP_GUARD=1 to get past an unrelated GPU timeout (Windows TDR) that ends unguarded runs at about 25 s. That setting caps every shader loop at one evaluation, so the rendering in these runs is not representative; it does not touch video decoding, which runs on the CPU through FFmpeg:
    • without the change: aborts at 88.7 s with the error above;
    • with the change: the intro cinematic decodes and plays until the 200 s cap. It presents at about 2.8 fps, which is a separate performance matter.
  • tools/check_conventions.py: no errors, one warning. docs/dev/debt/libSceVideodec2.md:11 is over the 1000-character debt length. That entry is 2072 characters on main and 1967 here; it had to change because it said the generic query throws for VP9.
  • tools/pr_overlap.py: no overlap with open pull requests.

Independent contributor validation: @xXPBSXx reports guest_videodec2 passing 3/3 on Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release with BUILD_TESTING=ON. Keeping this PR's test and restoring only libSceVideodec2/Export.cpp from merge base 6c12024f7d makes it fail 3/3; the PR's files were restored afterward. Only guest_videodec2_tests was built and one CTest test listed. The contributor did not run other tests, a title or console, or another platform; no exact PR-head SHA was supplied. These are attributed contributor results, not a locally repeated run.

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: PPSA34008 (no bring-up discussion yet)
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4945307459 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8839). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-21T02:11:43Z. --- ### What Mortal Shell 2 (PPSA34008) plays its intro movie through a VP9 Videodec2 decoder (`[videodec2] decoder 1: codec=2382845 max 3840x2160`) and asks for each picture's metadata with the generic `sceVideodec2GetPictureInfo` (`NtXRa3dRzU0`), not `sceVideodec2GetVp9PictureInfo`. On `main` the generic query throws for anything but H.264, and the title aborts 88.7 s in: ``` what(): Videodec2: picture info is only implemented for H.264 ``` A gdb breakpoint on the export shows the call: `output thisSize=56 pictureCount=1 first thisSize=88 second=nullptr`. 88 bytes is `sizeof(Vp9PictureInfo)`. `sceVideodec2GetPictureInfo` now writes the decoder's own layout for a VP9 picture: the same 88-byte VP9 structure `sceVideodec2GetVp9PictureInfo` returns, checked against `thisSize`. shadPS4's `videodec2.cpp` handles the generic query the same way, copying the decoder's own picture-info layout sized by the caller's `thisSize`. H.264 is unchanged. HEVC pictures still throw: no title calling the HEVC layout has been seen (as when #2161 was closed). ### Tested Windows 11 22621, AMD Radeon RX 6700 XT, WinLibs GCC 15.2 UCRT r7, Release, on `main` 6c12024f7. - `guest_videodec2`: the VP9 clip now also calls the generic query with a guarded 88-byte structure and checks that every field equals `sceVideodec2GetVp9PictureInfo`'s result and that the guard after it is intact. It fails without the library change (`Videodec2: picture info is only implemented for H.264`) and passes with it. - Full `ctest -j 32`: 1817 of 1819 pass. The other two fail the same way on `main`: `agc_driver_image_array_window_past_layer_limit` (does not build on MinGW, #8310/#8361) and `agc_driver_tessellation` (reported on #6679). - PPSA34008, same run directory and scene, two complete library sets built from 6c12024f7 that differ only in `libSceVideodec2.prx`; both runs used `APS5_LOOP_GUARD=1` to get past an unrelated GPU timeout (Windows TDR) that ends unguarded runs at about 25 s. That setting caps every shader loop at one evaluation, so the rendering in these runs is not representative; it does not touch video decoding, which runs on the CPU through FFmpeg: - without the change: aborts at 88.7 s with the error above; - with the change: the intro cinematic decodes and plays until the 200 s cap. It presents at about 2.8 fps, which is a separate performance matter. - `tools/check_conventions.py`: no errors, one warning. `docs/dev/debt/libSceVideodec2.md:11` is over the 1000-character debt length. That entry is 2072 characters on `main` and 1967 here; it had to change because it said the generic query throws for VP9. - `tools/pr_overlap.py`: no overlap with open pull requests. Independent contributor validation: [@xXPBSXx reports](https://github.com/boykopovar/AnyPS5/pull/8839#issuecomment-6310800898) `guest_videodec2` passing **3/3** on Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release with `BUILD_TESTING=ON`. Keeping this PR's test and restoring only `libSceVideodec2/Export.cpp` from merge base `6c12024f7d` makes it fail **3/3**; the PR's files were restored afterward. Only `guest_videodec2_tests` was built and one CTest test listed. The contributor did not run other tests, a title or console, or another platform; no exact PR-head SHA was supplied. These are attributed contributor results, not a locally repeated run. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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: PPSA34008 (no bring-up discussion yet) - [x] GPUs tested: n/a - [x] AI-assisted: yes
JJenkx commented 2026-10-21 02:31:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T02:31:11Z.


Linux data point: 844372448b merged onto main 6696def6e6 (clean). Linux 7.2.9, RX 6650 XT, RADV Mesa 26.2.4. PPSA34008 with the same scripted Cross presses:

  • main: stops about 50 s in with what(): Videodec2: picture info is only implemented for H.264, on a VP9 decoder (codec=2382845).
  • with this PR: the VP9 intro movie plays and the title reaches the "Welcome to Mortal Shell II" notice and the main menu (New Game / Options / Credits), running to the 300 s limit with no stop.

The title runs very slowly here (0.1-0.2 FPS), which is unrelated to this change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6306532852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8839#issuecomment-6306532852). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-21T02:31:11Z. --- Linux data point: `844372448b` merged onto main `6696def6e6` (clean). Linux 7.2.9, RX 6650 XT, RADV Mesa 26.2.4. PPSA34008 with the same scripted Cross presses: - main: stops about 50 s in with `what(): Videodec2: picture info is only implemented for H.264`, on a VP9 decoder (`codec=2382845`). - with this PR: the VP9 intro movie plays and the title reaches the "Welcome to Mortal Shell II" notice and the main menu (New Game / Options / Credits), running to the 300 s limit with no stop. The title runs very slowly here (0.1-0.2 FPS), which is unrelated to this change.
github-actions[bot] commented 2026-10-21 02:37:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T02:37:15Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 8119 docs/dev/debt/libSceVideodec2.md L11

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 core/libs/tests/GuestVideodec2.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6306608313 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8839#issuecomment-6306608313). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T02:37:15Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 8119](https://www.github.com/boykopovar/AnyPS5/pull/8119) | `docs/dev/debt/libSceVideodec2.md` [L11](https://github.com/boykopovar/AnyPS5/blob/cd700fe9ec0ec49a0394845605c3d42f2789c556/docs/dev/debt/libSceVideodec2.md#L11) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestVideodec2.cpp` |
JJenkx commented 2026-10-21 02:45:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T02:45:10Z.


Bring-up discussion for this title: #8844.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6306722642 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8839#issuecomment-6306722642). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-21T02:45:10Z. --- Bring-up discussion for this title: #8844.
JJenkx commented 2026-10-21 03:11:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T03:11:47Z.


Overlap with #8119: both edit the last sentence of the sceVideodec2CreateDecoder entry in docs/dev/debt/libSceVideodec2.md. #8119 changes only "sceVideodec2GetHevcPictureInfo is not exported" to "reports that it is not implemented"; this PR rewrites the clause before it (the generic query now answers VP9) and moves the VP9 detail to the sceVideodec2GetVp9PictureInfo entry. The code does not overlap. If #8119 merges first I will rebase and keep its wording for sceVideodec2GetHevcPictureInfo.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6307085103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8839#issuecomment-6307085103). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-21T03:11:47Z. --- Overlap with #8119: both edit the last sentence of the `sceVideodec2CreateDecoder` entry in `docs/dev/debt/libSceVideodec2.md`. #8119 changes only "`sceVideodec2GetHevcPictureInfo` is not exported" to "reports that it is not implemented"; this PR rewrites the clause before it (the generic query now answers VP9) and moves the VP9 detail to the `sceVideodec2GetVp9PictureInfo` entry. The code does not overlap. If #8119 merges first I will rebase and keep its wording for `sceVideodec2GetHevcPictureInfo`.
xXPBSXx commented 2026-10-21 07:44:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T07:44:21Z.


Independent Windows run of this PR (data only).

Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against main is clean. I built only guest_videodec2_tests; ctest -N -R guest_videodec2 lists exactly one test.

Results (3 runs each):

  • PR head: guest_videodec2 passes 3/3.
  • Baseline: I kept the PR's test and replaced only core/libs/prx/libSceVideodec2/Export.cpp with the version from the PR's merge base (6c12024f7d), then rebuilt. The test fails 3/3 (ctest reports Failed). I restored the PR's files afterwards.

Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6310800898 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8839#issuecomment-6310800898). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-21T07:44:21Z. --- Independent Windows run of this PR (data only). **Environment:** Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against `main` is clean. I built only `guest_videodec2_tests`; `ctest -N -R guest_videodec2` lists exactly one test. **Results (3 runs each):** - PR head: `guest_videodec2` passes 3/3. - Baseline: I kept the PR's test and replaced only `core/libs/prx/libSceVideodec2/Export.cpp` with the version from the PR's merge base (`6c12024f7d`), then rebuilt. The test fails 3/3 (ctest reports Failed). I restored the PR's files afterwards. **Not run:** other platforms, the other tests in the same family, the full repository CTest, and any title or console run. AI-assisted (Claude Code).
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!8839
No description provided.