Skip to content

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

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
JJenkx:windows/videodec2-generic-vp9-info
Oct 21, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
JJenkx:windows/videodec2-generic-vp9-info

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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 6c12024.

  • 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, test(agc): align the array window test's texels at run time #8310/test(agc): match array sample expectations to the view #8361) and agc_driver_tessellation (reported on feat(agc): run registered merged hull programs (binary type 3) #6679).
  • PPSA34008, same run directory and scene, two complete library sets built from 6c12024 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

🤖 Generated with Claude Code

sceVideodec2GetPictureInfo writes the decoder's own picture layout. For a
VP9 decoder it now writes the 88-byte VP9 layout that
sceVideodec2GetVp9PictureInfo returns, instead of throwing. Mortal Shell 2
(PPSA34008) calls the generic query with that structure for its intro
movie. HEVC pictures still throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 21, 2026
@JJenkx

JJenkx commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown

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

@JJenkx

JJenkx commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Bring-up discussion for this title: #8844.

@JJenkx

JJenkx commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

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

xXPBSXx commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

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).

@oneandonlydean
oneandonlydean merged commit bf272df into boykopovar:main Oct 21, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs prx unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants