fix(agc): follow RDNA 2's range checks for strided vertex fetches with OOB_SELECT 2 and 3 #9915
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9915"
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 ebarr24 on 2026-10-22T21:28:52Z.
What
A strided vertex fetch with OOB_SELECT 2 or 3 threw whenever its index was at or past NUM_RECORDS, which stopped Kena PPSA01746 (its own descriptor values are not captured yet) with the same message that The Eternal Cylinder PPSA06369 printed for stride 12, NUM_RECORDS 303 and vertex index 319706 (reported by JJenkx on #9604). RDNA 2 checks only NUM_RECORDS == 0 for OOB_SELECT 2, and for OOB_SELECT 3 compares NUM_RECORDS with the fetch's byte range without using the index (Mesa ac_descriptors.c at mesa-26.2.4, measured on gfx1036 in #2241). The fetch is now sized from its index in those cases, and the cases the hardware reads as zeros (NUM_RECORDS 0 for select 2, NUM_RECORDS below the fetch's bytes for select 3) still throw, while an indirect draw, whose counts are unknown when its vertex ranges are copied, still copies the descriptor's NUM_RECORDS range.
Tested
Windows 11, MinGW-w64 GCC 15.2, Release build with tests.
agc_vertex_input,agc_vertex_input_validation,agc_driver_strided_indirect_vertex_fetchpass with this change; the new test fails onmain.Validation layer (vulkan-sdk-1.4.363.0), on
main11f976b27cand on this change, withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_ADD_LAYER_PATHset to the layer,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1:ctest -V -R "strided_indirect|agc_graphics$|agc_vertex_input". Neither log containswas not found but was requested by env var VK_INSTANCE_LAYERS; the change adds noVUID-errors (0 with the change, 0 onmain).ctest -V log, main
The
***Failedresult and the failure line at its end are the new regression test failing onmain, as intended; they are not an unrelated baseline failure.ctest -V log, this change
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)mainand this change, no new VUIDs🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T23:33:11Z.
Review: CHANGES_REQUESTED
I’m requesting changes based on the Linux regression report posted in this PR. It reports two existing tests failing on the submitted behavior, in addition to the new execution-path test passing:
agc_driver_native_msaa_vertex_inputnow fails atSampleMultisampleTarget.cpp:580. Its OOB_SELECT 3 descriptor has stride 16 andNUM_RECORDS3. Under the byte-range rule this change implements, 3 is shorter than the 16-byte fetch, so the production rejection is expected; the fixture needs aNUM_RECORDSvalue consistent with the intended three-record test (the report suggests 48 bytes), or an assertion for the rejection if that is what the test intends.agc_vertex_inputstill expectsVertexBufferReadSize(input[0], 5, 1)to throw for OOB_SELECT 2. This PR changes that case to a valid read size (176 per the report), consistent with the stated RDNA 2 rule. Please update the stale expectation while retaining the zero-record rejection coverage.The report says these are the only failures among the 15 vertex tests it ran on RADV;
agc_driver_graphicsand the new stride-16 execution cases pass. Please update the affected fixtures/assertions and rerun the focused vertex test set, includingagc_driver_native_msaa_vertex_input,agc_vertex_input,agc_driver_zero_stride_vertex_fetch, andagc_driver_graphics. I have not reproduced the Linux GPU run locally; this request is based on the detailed independent run and the rule this PR implements.Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T07:34:25Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
This pull request does not merge cleanly into
main(d1ae628bc2): head1749190ad0conflicts indocs/dev/debt/libSceAgcDriver.mdPlease rebase it onto current
main. I will review the change once it merges cleanly.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T08:00:30Z.
Review: APPROVED
Reviewed — looks good
The reviewed change has no verified blocking defects; the submitted test results support the stated behavior.
What I ran
Reviewed head
1749190ad04bebffa6e6af7e2e1a87e7cd55b555. I read the prepared diff and targeted changed code; I did not run commands or tests in this session.Results
Negative control
Not run in this session. The author reports that the new regression test fails on
main.Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I did not run the build, tests, or validation layer. The author reports the targeted tests and validation-layer checks passed on Windows 11 with an NVIDIA GeForce RTX 3080. I read the changed hunks in
Graphics.cpp; its full 11,418-line text was not read. The other changed files were read at their relevant ranges. No files were excluded from the manifest.To get this to a good state
Nothing is required.
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.