Skip to content

fix(agc): allow chunked imports as vertex and index buffers - #6913

Open
JJenkx wants to merge 1 commit into
boykopovar:mainfrom
JJenkx:fix/chunk-import-vertex-index-usage
Open

JJenkx wants to merge 1 commit into
boykopovar:mainfrom
JJenkx:fix/chunk-import-vertex-index-usage

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Linux shared ranges fitting inside one 64 MiB udmabuf chunk can be bound directly as vertex or index input, but ChunkImportUsage omits both required usage flags. Override 2 (PPSA01907 v01.007.000) reports VUID-vkCmdBindVertexBuffers-pBuffers-00627 and VUID-vkCmdBindIndexBuffer-buffer-08784 with Vulkan validation.

Add VK_BUFFER_USAGE_VERTEX_BUFFER_BIT and VK_BUFFER_USAGE_INDEX_BUFFER_BIT to the existing usage mask, matching the ordinary host-pointer and sparse import paths. These are required by vertex-buffer binding and index-buffer binding. No allocation policy or draw ordering changes.

The regression imports an 8 MiB shared range, checks it takes the non-sparse dma-buf path, and checks the actual buffer creation flags admit both input roles.

Tested

Latest refresh: one linear topic commit 7ba8642a436deb6f0435a84e2beb4b705943ece4 on main 66e71b63d16eb07b940892ed2ad02afd625f7b3f, after #5390 merged. The conflict resolution retains upstream SparseBlockBytes and unaligned shared-range import support alongside this PR's vertex/index usage flags. All upstream device-replacement and unaligned-import tests remain, together with the existing 8 MiB small-import usage regression. Release libSceAgcDriver and the three test executables build. agc_host_import_sparse, agc_driver_graphics and agc_driver_sparse_dma_buf_import pass 3/3 on RADV and 3/3 on lavapipe, zero skips and zero core-validation errors/VUIDs (3.85 s / 3.31 s). Vulkan required, shader cache disabled. The host-import fixture uses mocked Vulkan with real Linux shared backing; lavapipe's real-device unaligned-range case reports a host-pointer import rather than sparse lead binding. Conventions, whitespace and a local merge-tree check pass. No fresh native title, full-suite, Windows or performance claim. Pinned report, RADV checks, lavapipe checks.

Historical validation below retains its original source revisions.

Head b3a58676bf108f830731f571975b810ef44b9dbe, one linear topic commit on main 93e54cedd3dd49eabf1c589f020b54758e0b6461. Linux 7.2.9-arch1-1, GCC 16.2.1 Release, Ryzen 9 7950X, RX 6650 XT / RADV Mesa 26.2.4-arch1.1; lavapipe Mesa 26.2.4 / LLVM 23.1.1.

  • Full libs and the three selected test executables build. agc_host_import_sparse, agc_driver_graphics, and agc_driver_sparse_dma_buf_import: 3/3 pass on RADV and 3/3 on lavapipe, no skips (4.42 s / 4.12 s). The first is a mocked Vulkan device with real Linux udmabuf backing, not a hardware shader test.
  • Negative control on main d9b696ddb with only the test added fails both missing-usage assertions. After adding the production fix, the exact same fixture executable passes; SHA-256 06618cfd9aed0f0e73f3efbcf1d8522bcdd8f7d07228309624969061985243b5.
  • Native Override 2, installed RADV, pipelined draws enabled, Khronos validation 1.4.363 verified in both process mappings: baseline reports both VUIDs; adding only this fix reports neither. Both reach the menu and close normally (exit 0), restoring temporary settings. Native validation uses main d9b696ddb; the rebase onto 93e54cedd adds only upstream test guards and keeps the production file byte-identical. Baseline also has inactive capture diagnostics and tools-only replay changes, none modifying host imports.
  • Separate CMASK host-stage and sampled-sRGB-view VUIDs remain, covered by fix(agc): include the host stage in the CMASK clear's host-access barriers #6781 and fix(agc): restrict sampled storage texture view usage #862 respectively; neither is a dependency of this fix. Dark 3D output remains unresolved. No visual fix, FPS gain, Windows validation or newly playable title is claimed.
  • Conventions and whitespace pass. Full hosted builds still need collaborator dispatch.

Sanitized validation and screenshot: chunk-import-usage-validation-public.json, chunk-import-usage-menu.png, chunk-usage-main93-radv-tests.log, chunk-usage-main93-lavapipe-tests.log. No raw guest code, assets or full title logs published.

Separate combined diagnostic: testing/override2-api-fixes-main93 adds lvmino97’s #862 and XairRrR’s #6781 to this PR; its Override 2 startup/menu run closes normally with zero validation errors, while dark rendering persists. Further Recorder validation, recorder-complete-main93-validation-public.json, covers AnzouBeli’s #5883, Dextroid17’s #6155 and MarcZX100’s #6642 plus a separate CoverPass fixture correction: the full Recorder flow passes with zero validation errors in dynamic and legacy modes on both RADV and lavapipe. These are separate integration/test changes, not dependencies or a visual-fix claim for this standalone import PR.

Additional title coverage: Infliction: Extended Cut (PPSA02688) reports both missing vertex/index usage VUIDs on the local main 84b0d2f248 diagnostic stack. A combined integration on main f51724078f adds this PR plus #6782, #6781 and #862; both buffer VUIDs and the independent-blend, sampled-sRGB-view and host-stage VUIDs are absent through gameplay and normal shutdown. One pre-existing shutdown leak report remains. This is combined integration evidence, not an isolated A/B for this PR; dark lighting remains unresolved. Sanitized protocol and results.

Crimson Spires integration validation (2026-10-19 UTC)

A combined integration on main 3b20a366caa8a8de5509e7add433c55275aa6f29, head cdcb1b9b55630aaf7db1164656660afb9500a2d5, includes #7681, #7627, #7630, #6959/#6934, #6913, #862 and #6782. Full libs builds and 13 focused checks pass on RX 6650 XT / RADV Mesa 26.2.4-arch1.1, Arch Linux, with required Vulkan and core validation, zero skips (7.44 s total).

The warm-cache PPSA03568 native run completed after 307.859 s with exit 0. It recorded zero Vulkan validation errors; two warning types remain (image subresource layer-count compatibility and shader output not consumed, ten occurrences each). The 295 s capture shows the car gameplay scene with visible road and dashboard; the user independently confirmed both menu and gameplay rendering looked good. This is combined-integration evidence, not an isolated result for this PR, a PS5 image-match claim or a performance comparison.

Sanitized pinned report · Gameplay capture

Checklist

  • Based on current main; no other open PR found adding these flags to ChunkImportUsage
  • One topic per PR; follow-ups separate
  • No new code comments
  • No silent stubs or new unimplemented paths
  • No investigation reports, game assets or images committed
  • No third-party code added
  • Generic Linux import behavior, not title-specific
  • Depends on: none
  • Unblocks: none (corrects Vulkan validation errors observed in PPSA01907; no bring-up stop or visible defect claimed fixed)
  • GPUs tested: AMD Radeon RX 6650 XT / RADV Mesa 26.2.4-arch1.1 and lavapipe Mesa 26.2.4 / LLVM 23.1.1, Linux 7.2.9-arch1-1
  • AI-assisted: yes

@github-actions github-actions Bot added the agc libSceAgc* label Oct 16, 2026
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1324 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4449 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6146 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6185 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6636 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6955 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp
PR 7233 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7292 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp
PR 7446 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7457 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7473 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7514 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7647 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 17, 2026
@JJenkx
JJenkx force-pushed the fix/chunk-import-vertex-index-usage branch from b3a5867 to b46f4ce Compare October 17, 2026 23:38
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
@JJenkx
JJenkx force-pushed the fix/chunk-import-vertex-index-usage branch from b46f4ce to 7ba8642 Compare October 18, 2026 05:34
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@JJenkx

JJenkx commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Additional native evidence: Crimson Spires PPSA03568, opening-car dialogue, Linux / RX 6650 XT / RADV Mesa 26.2.4-arch1.1, default Khronos core validation enabled.

Baseline 355de8bdfcf25fb2af95ae9884c4163b10ac640d is main c4c2b3aa7371ee988c94ca62f1431ebaaf0688c8 plus the depth-bounds and scheduled-jump-table bring-up fixes (#7627 and #7630). It emits 10 validation headers each for VUID-vkCmdBindVertexBuffers-pBuffers-00627 and VUID-vkCmdBindIndexBuffer-buffer-08784: the chunk-import buffer lacks vertex/index usage. These counts are capped emitted messages, not a count of all invalid calls.

A local integration at bc8fdb728ff348c92fe5a65c0eefa80d03d097a7 adds this exact topic plus #6782 (independent blend), #6781 (CMASK host barrier stages), and #862 (sampled image-view usage). Both buffer VUIDs disappear; the other four baseline error categories also disappear. The two pre-existing warning categories remain. This is combined-integration evidence, not an isolated native A/B of #6913.

Both runs use a 1536x864 window, the same input schedule, APS5_HOST_IMPORT_MIB=16384, APS5_DRAW_CACHE_ENTRIES=4096, APS5_PIPELINED_DRAWS=1, and APS5_PLAYGO_UNLISTED_CHUNKS=installed, with retained caches. Both reach the same car dialogue and close normally at about 233 seconds; both PIDs are gone and the temporary udmabuf limit is restored to 64 MiB. The dark/malformed 3D scene persists. No visual fix or speedup is claimed.

Integration full libraries and affected fixtures build; agc_driver_graphics, agc_sampled_storage_base_level_usage, agc_host_import_sparse, and agc_driver_sparse_dma_buf_import pass 4/4 without skips (4.11 seconds). The separate CMASK draw/eliminate fixture also passes. Existing isolated buffer regression evidence above remains the evidence specific to this topic.

AI-assisted validation/reporting: yes.

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 18, 2026
@adriadam10 adriadam10 self-assigned this Oct 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants