Repository navigation
fix(libSceAgc): encode multi-draw and base indirect arguments as the console does - #20182
Merged
oneandonlydean merged 1 commit intoNov 14, 2026
Conversation
…console does sceAgcDcbDrawIndexIndirectMulti and sceAgcDcbDrawIndirectMulti threw for unaligned offsets, short or unaligned strides, count selectors other than 0 and 1, and a count address passed with a direct count. sceAgcDcbSetBaseIndirectArgs threw for shader types above 1, addresses that are not 8-byte aligned and addresses above 48 bits. Prosper's console measurements encode all of these; the nine cases now match. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
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.
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.
|
angrysandhill
added a commit
to angrysandhill/AnyPS5
that referenced
this pull request
Nov 14, 2026
Resolve known.tsv by removing both the multi-draw and base indirect rows boykopovar#20182 removed and this change's register-direct rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three libSceAgc packet builders threw for arguments that a PS5 encodes:
sceAgcDcbDrawIndexIndirectMultiandsceAgcDcbDrawIndirectMultithrew for an unaligned data offset, an unaligned or short stride, a count selector other than 0 or 1, and a count address passed together with a direct count.sceAgcDcbSetBaseIndirectArgsthrew for a shader type above 1, an address that is not 8-byte aligned and an address above 48 bits.Prosper's console measurements (
DcbDrawIndexIndirectMulti_a/b/c,DcbDrawIndirectMulti_a/b/c,DcbSetBaseIndirectArgs_a/b/c) show that the console:SET_BASEheader as 0xc0021100 with the whole 32-bit shader type shifted left by one ORed in, clears bits 1 and 2 of the address and writes its high dword whole. For example shader type 0x11111111 with address 0x22222222 givese2223322 00000001 22222220 00000000.This PR encodes those arguments the same way. The nine cases now match and their rows are removed from
tools/library-oracle/known.tsv.Not settled by the measurements, so these still throw and are recorded in
docs/dev/debt/libSceAgc.md:sceAgcDcbSetBaseIndirectArgsaddress: the three measured addresses have bits 0, 3 and 4 clear, so they fit a mask of the low 3, 4 or 5 bits. Bits 3 and 4 are kept, as before, on the assumption of an 8-byte alignment.The multi-draw modifier is a seventh argument that the measurements do not pass; the measured packets equal those of a zero modifier. The driver's handling of these packets is unchanged.
tools/pr_overlap.pyreports textual conflicts only, no shared exports:DrawPatchOffsets/DrawInitiatorcall signatures inside the two multi-draw functions; it leaves their checks in place, and says so.known.tsv.main; they touchdocs/dev/debt/libSceAgc.md(andknown.tsvfor fix(agc): correct PRIME_UTCL2 arguments and packets #19191) for other functions (suspend points, PRIME_UTCL2).Tested
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 (r7), Release,
BUILD_TESTING=ON, onmain61f33fc and on this branch:ctest --test-dir build-main -R '^(agc_commands|agc_draw_setup|guest_indexed_draw)$' -VwithANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: 3 of 3 pass on both. Neither log containswas not found but was requested by env var VK_INSTANCE_LAYERSor anyVUID-line. These tests build packets on the CPU and create no Vulkan device.agc_commandsnow checks the nine console packets, and that a selector of 1 with a null count address, an odd selector above 1 and an odd base address are refused without touching the buffer.python3 tools/library-oracle/library_oracle.py --build build-mainafterlibsandlibrary_oracle_replaywere rebuilt:155 known findings, 0 new, 0 now matchingwith the nine rows removed.python3 tools/check_conventions.py --base origin/main: all checks passed.No title was run.
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)🤖 Generated with Claude Code