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

Merged
JJenkx merged 1 commit from upstream-pr/6913 into main 2026-11-08 09:08:08 +00:00
JJenkx commented 2026-10-16 17:53:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-16T17:53:54Z.


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 (2026-10-23): one linear topic commit d89f7050b7de6e7ec337f8edfcc8e41feb644b7b on main 938812df1403f9616dba71744216725891ca4979. Retains current upstream sparse and unaligned-import behavior. The branch also merges cleanly against main 15e71dbe1116517913c5fbf309aa86d102285da3 at publication. Full Release libraries and the three focused test executables build on GCC 16.2.1/Linux.

On the same RX 6650 XT/RADV setup, agc_host_import_sparse, agc_driver_graphics, and agc_driver_sparse_dma_buf_import pass on both pinned main and the change: three tests per arm, no skips, validation layer loaded, zero VUIDs. The first two fixtures use mocked Vulkan; the sparse-import test exercises the real device. With the exact unchanged candidate fixture executable and the baseline library (loader path verified), both missing vertex/index usage assertions fail. Restoring the candidate library passes; the fixture SHA-256 is unchanged. No fresh title, Windows, lavapipe, full-suite, visual or performance result is claimed for this refresh. Pinned receipts and logs.

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 #6781 and #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 comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Fixes: none
  • 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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4892236811 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6913). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-16T17:53:54Z. --- ### 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](https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdBindVertexBuffers.html) and [index-buffer binding](https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdBindIndexBuffer.html). 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 (2026-10-23):** one linear topic commit `d89f7050b7de6e7ec337f8edfcc8e41feb644b7b` on main `938812df1403f9616dba71744216725891ca4979`. Retains current upstream sparse and unaligned-import behavior. The branch also merges cleanly against main `15e71dbe1116517913c5fbf309aa86d102285da3` at publication. Full Release libraries and the three focused test executables build on GCC 16.2.1/Linux. On the same RX 6650 XT/RADV setup, `agc_host_import_sparse`, `agc_driver_graphics`, and `agc_driver_sparse_dma_buf_import` pass on both pinned main and the change: three tests per arm, no skips, validation layer loaded, zero VUIDs. The first two fixtures use mocked Vulkan; the sparse-import test exercises the real device. With the exact unchanged candidate fixture executable and the baseline library (loader path verified), both missing vertex/index usage assertions fail. Restoring the candidate library passes; the fixture SHA-256 is unchanged. No fresh title, Windows, lavapipe, full-suite, visual or performance result is claimed for this refresh. [Pinned receipts and logs](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr6913-headd89f7050-linux-validation.tar.gz). **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 #6781 and #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](https://github.com/JJenkx/AnyPS5/releases/tag/game-library-checks-20261016): `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](https://github.com/JJenkx/AnyPS5/tree/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](https://github.com/JJenkx/AnyPS5/releases/tag/game-library-checks-20261016), `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](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/infliction-api-fixes-mainf517-public.json). ### 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](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/crimson-validation51-public.json) · [Gameplay capture](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/crimson-main3b20-validation51-gameplay.png) ### Checklist - [x] Based on current `main`; no other open PR found adding these flags to `ChunkImportUsage` - [x] One topic per PR; follow-ups separate - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Fixes: none - [x] Depends on: none - [x] Unblocks: none (corrects Vulkan validation errors observed in PPSA01907; no bring-up stop or visible defect claimed fixed) - [x] 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 - [x] AI-assisted: yes
JJenkx commented 2026-10-18 19:33:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-18T19:33:55Z.


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6254216522 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6913#issuecomment-6254216522). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-18T19:33:55Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6913
No description provided.