feat(agc): source indirect instance user data from BaseInstance #10359
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10359"
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 valenciana-nc on 2026-10-23T19:11:26Z.
What
Add a narrowly gated GPU-indirect vertex route for a numeric start-instance SGPR that cannot safely be folded into the instance index. The reported pattern
v8 + low16(s10)followed by an s10 overwrite comes from @ponhei9502 in #5806; this does not claim to close that issue or unblock a title.BaseInstance; initialize the guest instance index fromInstanceIndex - BaseInstance. Preserve guest masked arithmetic and later SGPR writes. Sources: Khronos BaseInstance and InstanceIndex; console-equivalence gaps remain in the library debt entry.asBase | asValue. Allocation failures still propagate.instanceInputSgprremains independent of tracing or heap state, and is assigned beforeInvocationFor.Current-main serialization conflict resolution
Main now owns formats 47/48/49, including format-49 depth-export bounds. This rebase preserves main's ordinary 49 bytes, format-47 dither semantics, format-48
fragmentBarycentricBuiltinsand format-49 depth fields. Only instance-input requests write 50, appending the SGPR after main's existing fields; the reader accepts through 50. Older main requests default to ordinary mode. Captures made with earlier versions of this PR's routed 46/47/49 layouts must be recaptured; those layouts are not interchangeable with main's formats.Updated tests cover both barycentric values, ordinary-49 byte round trips, main-47/48 replay defaults, routed-50 SGPRs 8/10/11/39, each 1–4-byte truncated route suffix, unexpected trailing bytes, a legacy-layout extra suffix and missing graphics context. Routed bytes must equal the corresponding ordinary request with only its version changed and SGPR appended. Depth-export enabled/disabled cases retain the flag and nondefault bounds (0.25/0.75 when enabled), independently of both barycentric values. Existing main depth/legacy fixtures stay unchanged. Both unsupported-future-version fixtures (
RequestSerializerTests.cppandShaderMemory.cpp) now reject 51.Ownership and merge-order coordination
This is independently authored GPU-route work, not #9243/#9248's CPU optimization. Historical scans/coordination identified shared materialization and serialization hunks, with incomplete older comparisons; no blanket overlap all-clear or combined-stack validation is claimed. #9193, #10846 and #10348's authors agreed #10359 first; #7642's author clarified it is stacked on #9508. Those are merge-order statements, not runtime dependencies or permission to reuse format 47. Subsequent integrations must preserve all main fields, keep numeric SGPR and heap state separate and allocate the next available layout. Earlier scan and coordination evidence.
The optional base-vertex extension offered by @mrfelek is not included in this rebase; it remains separate work, and its reported title/GPU measurements are not this PR's validation.
Tested
2026-10-28 rebase: pinned main
e4da19aff06e25ae16b90f460dff22e8ac1eb786, tested head0f420f29bc99c951e80a7f8c49992ae10e148a35. Windows 11 x86-64 build 26300, Intel i7-13650HX, NVIDIA GeForce RTX 4060 Laptop GPU / NVIDIA 610.62, WinLibs GCC 15.2.0 r7, Release,BUILD_TESTING=ON.Before pushing, a clean
git merge-treepreview against newer main319621ba2e578bd053b0baba2877fe70520e0737also succeeded; its ordinary serializer remains 49. That preview is an integration check, not a runtime test of the later main tip. Runtime counts below belong to the explicitly pinned baseline and head above.libsand affected executables rebuilt on main and this head.request_serializercovers the updated 47/48/49/50 compatibility matrix and depth-export fields described above.agc_shader_memoryincludes current main's depth, legacy and target-tail checks as well as the future-version rejection. These main fixtures were not blindly renumbered to the routed format.VUID-, synchronization hazards, or validation errors/warnings were found; this is not inferred from CTest's pass result alone.Exact same-machine GPU environment and common commands:
The PM4 fixture has a compute shader write draw records, then executes actual driver draws with exact-output/path checks. The semantic fixture checks wave32/wave64, high-bit bases, UINT32_MAX and later SGPR writes. GPU route, cache identity and tracing behavior are unchanged by this format-resolution follow-up. The base-vertex contributor extension was not imported or tested.
git diff --checkand scoped current-main conventions pass. The requiredpython tools/check_conventions.py --base origin/mainwas also run: both unmodified pinned main and this head return 1 with the identical inherited[commit-subject]finding for upstream revert97f1d41a2c(plus older-fork debt-length warnings). No PR-specific errors appear against current upstream main. The upstream revert was not rewritten and the stale fork tracking ref was not manipulated to hide this result. Current evidence is underoct28-*, including full commands, verbose logs, binary hashes, range-diff andoct28-provenance.json.resume-*and older artifacts are historical, not current-head evidence. Hosted checks from the prior head are not a current-head runtime pass.Earlier 27-test/negative-control/extra tracing evidence remains in the historical gist, not freshly repeated on this base. No commercial-title, console, other-GPU/OS, full-suite, combined-stack, speedup or complete per-subdraw trace-attribution result is claimed. An older approval is not independent exact-new-head validation. AI-assisted.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Local validation logs and scope.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T19:17:28Z.
Review: APPROVED
I reviewed the indirect-instance route selection, shader input mapping, cache/request identity changes, and the focused regression coverage. The candidate is narrowly gated to the indirect start-instance SGPR, excludes conflicting base-vertex/resource/decoded-input paths, and keeps CPU fallback for unsupported shader modes. The translator supplies Vulkan
BaseInstanceto that SGPR and subtracts it from VulkanInstanceIndex, whose specified value starts atfirstInstance(Khronos Vulkan spec: https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#interfaces-builtin-variables). The cache key and serialized request include the route, and the tests cover route changes, fallback, high-bit values and later SGPR writes.The PR reports paired baseline/change execution of the focused suite on an RTX 4060 with validation layers, including the synthetic end-to-end regression. I did not rerun those GPU tests locally. Current hosted eligibility, conventions, intake, labels and report checks pass; product and relinker jobs are skipped by path policy. I found no blocking issue in the reviewed changes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T06:02:03Z.
Review: CHANGES_REQUESTED
Re-checked — changes requested
What I checked
0f420f29bc99c951e80a7f8c49992ae10e148a35against fetchedmain2960e9a6e7.git diff --checkpasses, and the reviewed scope includes route gating, cache identity, and request-format compatibility. Hosted Windows, relinker, conventions, and eligibility checks pass; product Linux and specialized GPU jobs were skipped.e4da19aff0, including 19/19 controls and 18/18 repeated GPU-route runs.Blocking current-head validation
The tested runtime baseline is
e4da19aff0; the newermainmerge preview in the report is319621ba2e, which the author explicitly says was an integration check rather than a runtime test. Fetched currentmainis now2960e9a6e7, 297 commits ahead of this branch. Because this changes shader translation, cache identity, and serialized requests, a clean merge preview alone does not validate their interaction with the newer tree. Please refresh onto currentmainand rerun the focused serializer, shader-memory, and GPU-route tests with the validation layer on the refreshed integration head.I found no new code defect in this read, but the previous approval predates this head and the current integration has not had runtime validation. I cannot renew approval until that evidence is available; I did not run GPU tests locally.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.