Repository navigation
fix(agc): resolve a relocated AGC header whose arrays hold the registered bytes - #6966
Conversation
|
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.
|
|
AMD / Windows run of this PR at fb07b68: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release. Every ctest entry built from the test targets this PR changes passes (11):
AI-assisted: yes (runs made on the device above). |
…ered bytes A title can relocate a registered shader header, and the register, special and semantic arrays it points at, into memory of its own and resolve the ABI with that copy (Astro's Playroom, PPSA01325, boykopovar#2914). SameHeader accepted such a copy only while every pointer inside it stayed put, so a moved array left the resolution throwing "refers to a replaced shader header". Accept the copy when every array it names still holds the registered bytes: the registered header then decodes what the copy describes, nothing is copied and ShaderSnapshot stays immutable. A copy whose arrays differ or are unreadable still throws.
fb07b68 to
943b700
Compare
|
Checked the diff (array bounds in |
What
A title can relocate a registered
Shaderheader — and the register, special and semantic arrays it points at — into memory of its own, then resolve the ABI with that copy, which it never registered (ResolveShaderAbi,ResolveGraphicsStagesAbi,ResolveGraphicsAbi).SameHeaderaccepted such a copy only while its pointers stayed put:RelocatedRegisterscovers a moved register array alone, and the fixed-field comparison covers the case where onlyuser_datamoved. Once another referenced array moved with the header,RegisteredHeadermatched nothing and the resolution threwgraphics ABI refers to a replaced shader header. Astro's Playroom (PPSA01325) resolves its vertex ABI with such a copy (#2914, discussion #3232).A copy is now accepted when every array it names still holds the registered bytes. The registered header then decodes exactly what the copy describes, so nothing is copied, no snapshot is published and
ShaderSnapshotstays immutable.What a copy's pointers cannot change is content, and that is what the check now compares:
user_datanot compared and the register, context-register, specials, input-semantic and output-semantic pointers masked;A copy whose registers, context registers, specials or semantics differ, or whose fixed fields differ, still throws
... refers to a replaced shader header— exact-or-throw is unchanged.Not the earlier attempts
#2969, #4043 and #5830 published or mutated a snapshot for the relocated header. This keeps the registry, the snapshot and its decoded program untouched: the acceptance test reads guest memory only, so a relocated call costs a bounded comparison and no allocation. There is no new snapshot, no
PublishRegisteredShadercall and no mutable member.Tested
Windows 11 26200.8117, winlibs GCC 15.2.0, Ninja, Release. GPU: NVIDIA GeForce GTX 1650 Ti, driver 617.14 (Vulkan).
tests/execution/PreparedShaders.cppgainsRelocatedHeaders(), called from the default run besideSharedCodeHeaders():user_datapointer;replaced shader header.On unmodified
main(e9a3343) the same test fails at the first copy:With this change:
The 11 modes are the default, indirect, uncached, debug, debug_failure, deferred, deferred_undecodable, registered_workgroup, registered_workgroup_sync, lazy and lazy_sync runs of the same binary;
SharedCodeHeadersandRegistrationcases are inside them.Checklist
main; no other open PR implements the same functions (fix(agc): update snapshot header and bytes on relocated header ABI resolution #2969, fix(agc): publish relocated shader snapshot on ABI resolution #4043, fix(agc): refresh relocated shader snapshot headers #5830 are closed; the open PRs that share these files touch other behaviours)docs/dev/debt/libSceAgcDriver.mdis extended).mdfiles or images added to the repositoryuser_data-only copy and PPSA01325's relocated copy both take this path)agc_driver_prepared_shaders, all 11 modes)