Skip to content

fix(agc): sample a 2D instruction over a 2D array texture through its first layer - #181

Merged
boykopovar merged 1 commit into
boykopovar:mainfrom
oneandonlydean:fix/agc-sample-2d-over-array
Oct 1, 2026
Merged

boykopovar merged 1 commit into
boykopovar:mainfrom
oneandonlydean:fix/agc-sample-2d-over-array

Conversation

@oneandonlydean

@oneandonlydean oneandonlydean commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

What

Follow-up to #131 (merged); rebased onto current main, so this branch is now the one commit on top of it.

#131 binds a 2D storage access to a 2D array surface as the surface's first layer. The sampled path had the same gap: a shader sampling with MIMG DIM 2D over a T# of type 2D array was refused with "guest texture dimension disagrees with the shader's declared image shape (shape 1, dimension 2)". The access carries no slice coordinate, so the hardware samples slice 0 of the resource view, the BASE_ARRAY layer.

A 2D array Texture now also makes a 2D view of that layer (Texture::FirstLayerView), both for a texture that holds its own snapshot and for one that views the surface's storage image. The view is created with the full view and released with it. resolveImageBinding accepts exactly this case (2D shape over a 2D array dimension) and binds the first-layer view; every other shape/dimension mismatch still throws.

In PPSA21564 a compute shader samples a 2D array texture this way from the intro's warp effect on; the dispatch was skipped every time.

If #130 (MIN_LOD) merges first, the first-layer view picks up its VkImageViewMinLodCreateInfoEXT through the copied create info, since it is created while the full view's chain is still alive.

Tested

  • Linux (CachyOS, RTX 4090): firstLayerViewTests in agc_driver_recorder_tests (from fix(agc): bind a 2D storage access to a 2D array surface as its first layer #131) now also samples a 2D array snapshot texture and a sampled view of a 2D array storage image through FirstLayerView() and checks both read the BASE_ARRAY layer, and checks that a 2D texture has no first-layer view. Without the view creation the test fails with "a sampled 2D array texture has no first-layer view"; on fix(agc): bind a 2D storage access to a 2D array surface as its first layer #131 alone it does not build (no Texture::FirstLayerView).
  • Exercised in PPSA21564 on our integration branch: the warp's sampling dispatch runs.
  • ctest: 85/85 pass on current main with this branch. agc_driver_recorder_tests and agc_driver_graphics_tests pass.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none (fix(agc): bind a 2D storage access to a 2D array surface as its first layer #131 is merged)
  • AI-assisted: yes

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed build agc libSceAgc* labels Sep 30, 2026
@oneandonlydean
oneandonlydean force-pushed the fix/agc-sample-2d-over-array branch from 3da5558 to 05dba97 Compare September 30, 2026 19:48
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Sep 30, 2026
… first layer

A shader sampling with MIMG DIM 2D over a T# of type 2D array was
refused: "guest texture dimension disagrees with the shader's declared
image shape (shape 1, dimension 2)". The access carries no slice
coordinate, so the hardware samples slice 0 of the resource view, the
BASE_ARRAY layer, as it does for the storage access of the previous
commit.

A 2D array Texture now also makes a 2D view of that layer
(Texture::FirstLayerView), whether it holds its own snapshot or views the
surface's storage image, and the sampled binding uses it for such an
access. Every other shape/dimension mismatch still throws.
@oneandonlydean
oneandonlydean force-pushed the fix/agc-sample-2d-over-array branch from 05dba97 to 74abc7a Compare October 1, 2026 07:58
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 1, 2026
@boykopovar
boykopovar merged commit 9623054 into boykopovar:main Oct 1, 2026
3 checks passed
@oneandonlydean
oneandonlydean deleted the fix/agc-sample-2d-over-array branch October 1, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants