fix(libSceNgs2.native): clamp matrix levels to -4..4 as the PS4 libSceNgs2 does #2337
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2337"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-09T15:49:05Z.
What
SCE_NGS2_VOICE_PARAM_MATRIX_LEVELSand the matrix levels command ofsceNgs2VoiceRunCommandsstored levels as given. Now:TechnicalDebt records that this comes from the PS4 library.
Reference
libSceNgs2.sprx, dumped and decrypted from a console. It was loaded on Windows with a small test loader and driven throughsceNgs2VoiceControl; neither the loader nor the library is part of this PR. In-range, out-of-range, infinite and NaN levels were set and read back from its rendered output, and a count of 0 was rejected with the matrix unchanged.sceNgs2VoiceRunCommandsis not in the PS4 library, so its matrix levels command is assumed to clamp the same way.libSceNgs2.sprx: its readable ELF headers match the PS4 library (3,460-byte.eh_frame_hdr, 431 functions). A decrypted PS5 SELF was not used; anyone with a decrypted PS5libSceNgs2.sprxcan help confirm this.Tested
ngs2_renderTestMatrixLevelClamprenders a mono sampler through matrix 0, set both by voice param and by command: ±4, 4.0001, -4.5, ±100 and ±infinity render as ±4 would, 3.5 and -0.25 pass unchanged, NaN stays NaN, and a count of 0 throws.main'sVoice.cppthe test fails. Four mutations each make it fail: no clamp, no upper bound, a bound of 8, and accepting a count of 0.maind70b8998, together with #959, #964 and #2336: 507/507.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-09T17:52:47Z.
Tested on Linux (CachyOS x86_64, Intel RPL-S iGPU / Mesa 26.3.0-devel / Vulkan 1.4.363, GCC 16.2.1) at
255ed1de:/tmp/anyps5_build) with zero warnings/errors.python3 tools/check_conventions.py --base origin/main --head HEAD-> PASS (0 errors).Voice.cppandngs2_rendertests. Matches hardware and PS4 libSceNgs2 specifications.LGTM!