feat(libSceGnmDriver): add mode-aware VGT control writers #17942

Merged
johnohhh1 merged 3 commits from upstream-pr/17942 into main 2026-11-14 23:26:03 +00:00
johnohhh1 commented 2026-11-10 00:14:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-11-10T00:14:07Z.


What

Adds sceGnmSetVgtControl and sceGnmResetVgtControl to normal libSceGnmDriver. Issue #17581 reports these missing imports for inFAMOUS Second Son (CUSA00223 01.07, bring-up #8214):

FAIL: unresolved ELF import MYRtYhojKdA
FAIL: unresolved ELF import cFCp0NX8wf0

The provider selects base SET_CONTEXT_REG or native Neo SET_UCONFIG_REG through sceKernelIsNeoMode. Invalid arguments return −1 before the mode query; unsupported/absent metadata throws without writing. Existing Neo implementations remain unchanged. _nid_disambig1 keeps host names distinct while retaining guest NIDs.

Semantics/signatures: shadPS4 a808e762. Normal-provider identities: PS5 3.20 inventory b2a77c09. Optional compatibility substitution is not added; console packet equivalence remains debt.

This supplies two of 47 reported imports; it does not close #17581 or claim title startup. #17711 and #18251 cover different functions, with no runtime prerequisite here.

November 14: merged current main to include its #19489 socket-test revert and request fresh CI. Original contribution history is retained; no new feature or test relaxation is added.

Tested

Fresh head 58a548988b4b9e33e07c71e7222ad4f77a2c8884, frozen main 3c620812fbf9040bd8aa30612a12bb1b012f212f. Identical fixtures, separate rebuilt main/PR production; Ubuntu 26.04.1/GCC 15.2/Release, SPIRV-Tools enabled:

Device Main + fixtures Refreshed PR
RTX 5070 /595.99.02 11/15 15/15
llvmpipe /Mesa 26.0.8 /LLVM 21.1.8 11/15 15/15

Both full configured Linux builds pass. Four normal-provider cases fail on main at the missing exports; all eleven controls pass. Required Vulkan, disabled shader cache, explicit ICDs, Khronos validation 1.4.341 and VK_LOADER_DEBUG=layer: layer insertion confirmed on both devices, no skips, missing-layer warnings or VUID errors. New VGT cases check CPU packet words; the existing submission control performs GPU work.

The fixture is byte-identical to the preceding submitted version. Writable provider/mode cases exhaust 1,024 argument combinations, reset output and guards; invalid arguments/metadata leave the buffer untouched. Earlier NID-patched-PRX tests and public-header audits remain in the discussion, tied to their original revisions.

Earlier hosted Windows job on eefa9b38f7 built successfully and passed all six VGT cases, but failed only the socket assertion reverted by #19489. It is not a Windows run of this refreshed head. Fresh hosted checks are pending after publication; no green result is assumed.

Conventions and clean current-main merge preview pass. Existing-main name warnings are intentional second-provider names; the previous #14212 shared-debt comparison contains only blank-line additions. No full runtime suite, fresh Windows/macOS, native AMD, console or title execution claimed.

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: NVIDIA GeForce RTX 5070 /595.99.02 and llvmpipe /Mesa 26.0.8 /LLVM 21.1.8, Ubuntu 26.04.1; new VGT tests are CPU packet checks
  • AI-assisted: yes (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5233396731 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17942). Originally posted by [johnohhh1](https://github.com/johnohhh1) on 2026-11-10T00:14:07Z. --- ### What Adds `sceGnmSetVgtControl` and `sceGnmResetVgtControl` to normal `libSceGnmDriver`. [Issue #17581](https://github.com/boykopovar/AnyPS5/issues/17581) reports these missing imports for inFAMOUS Second Son (CUSA00223 01.07, [bring-up #8214](https://github.com/boykopovar/AnyPS5/discussions/8214)): ```text FAIL: unresolved ELF import MYRtYhojKdA FAIL: unresolved ELF import cFCp0NX8wf0 ``` The provider selects base `SET_CONTEXT_REG` or native Neo `SET_UCONFIG_REG` through `sceKernelIsNeoMode`. Invalid arguments return −1 before the mode query; unsupported/absent metadata throws without writing. Existing Neo implementations remain unchanged. `_nid_disambig1` keeps host names distinct while retaining guest NIDs. Semantics/signatures: [shadPS4 a808e762](https://github.com/shadps4-emu/shadPS4/blob/a808e7626e3c7de8d0f0fda6a91f620b42f6c762/src/core/libraries/gnmdriver/gnmdriver.cpp). Normal-provider identities: [PS5 3.20 inventory b2a77c09](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceGnmDriver.c). Optional compatibility substitution is not added; console packet equivalence remains debt. This supplies two of 47 reported imports; it does not close #17581 or claim title startup. #17711 and #18251 cover different functions, with no runtime prerequisite here. November 14: merged current main to include its #19489 socket-test revert and request fresh CI. Original contribution history is retained; no new feature or test relaxation is added. ### Tested Fresh head `58a548988b4b9e33e07c71e7222ad4f77a2c8884`, frozen main `3c620812fbf9040bd8aa30612a12bb1b012f212f`. Identical fixtures, separate rebuilt main/PR production; Ubuntu 26.04.1/GCC 15.2/Release, SPIRV-Tools enabled: | Device | Main + fixtures | Refreshed PR | |---|---:|---:| | RTX 5070 /595.99.02 |11/15|15/15| | llvmpipe /Mesa 26.0.8 /LLVM 21.1.8 |11/15|15/15| Both full configured Linux builds pass. Four normal-provider cases fail on main at the missing exports; all eleven controls pass. Required Vulkan, disabled shader cache, explicit ICDs, Khronos validation 1.4.341 and `VK_LOADER_DEBUG=layer`: layer insertion confirmed on both devices, no skips, missing-layer warnings or VUID errors. New VGT cases check CPU packet words; the existing submission control performs GPU work. The fixture is byte-identical to the preceding submitted version. Writable provider/mode cases exhaust 1,024 argument combinations, reset output and guards; invalid arguments/metadata leave the buffer untouched. Earlier NID-patched-PRX tests and public-header audits remain in the discussion, tied to their original revisions. Earlier [hosted Windows job on `eefa9b38f7`](https://github.com/boykopovar/AnyPS5/actions/runs/43411721998/job/131867136585) built successfully and passed all six VGT cases, but failed only the socket assertion reverted by #19489. It is not a Windows run of this refreshed head. Fresh hosted checks are pending after publication; no green result is assumed. Conventions and clean current-main merge preview pass. Existing-main name warnings are intentional second-provider names; the previous #14212 shared-debt comparison contains only blank-line additions. No full runtime suite, fresh Windows/macOS, native AMD, console or title execution claimed. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### 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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA GeForce RTX 5070 /595.99.02 and llvmpipe /Mesa 26.0.8 /LLVM 21.1.8, Ubuntu 26.04.1; new VGT tests are CPU packet checks <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes (Codex) <!-- yes / no -->
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!17942
No description provided.