Skip to content

feat(agc): render into one depth slice of a 3D color target - #449

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
MichonGoddijn231849:feat/3d-color-targets
Oct 4, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
MichonGoddijn231849:feat/3d-color-targets

Conversation

@MichonGoddijn231849

Copy link
Copy Markdown
Contributor

What

A color target whose CB_COLOR_ATTRIB3 resource type is 3D was refused with unsupported color depth, dimension, resource level or metadata mode. GTA V renders a 32x32x32 2_10_10_10 volume this way, one depth slice per color view, while loading.

  • Decode: DecodeColorTileMode accepts resource type 3D (any depth); type 2D still requires depth 0. DecodeColorBuffer reads the depth and takes the view slice as the depth slice (ColorTarget::depth, depthSlice). The surface address is not moved by the slice, as for array slices. Mipmapped and DCC 3D targets throw, and so does a slice beyond the depth.
  • Draw: SurfaceForTarget describes the target as a 3D surface. The resident storage image is attached through a 2D view of the depth slice. A 3D target without a resident image throws.
  • Storage images: 3D images are created 2D_ARRAY_COMPATIBLE and can be color attachments. StorageTexture::AttachmentView takes the depth slice, and its view cache key includes it.

Tested

Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.

  • ctest: all tests pass. agc_driver_graphics checks the new decode:
    • a view of depth slice 2 of a 4-deep 3D target keeps the surface address and selects slice 2;
    • slice 4 is refused;
    • a DCC 3D target is refused.
  • GTA V (PPSA04264), Prologue: the draw was refused at load. It now renders, with no skipped draws left in the Prologue, and the scene looks as before. Tested on my branch that combines this change with my other open PRs.

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
  • Generic behaviour, not specific to one title
  • Depends on: feat(agc): 4 KiB standard color targets and color views of one array slice #377 (color views of one array slice); its commit is included here until it merges
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

MichonGoddijn231849 added a commit to MichonGoddijn231849/AnyPS5-fork that referenced this pull request Oct 3, 2026
…ar#449)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 3, 2026
MichonGoddijn231849 and others added 2 commits October 4, 2026 12:24
…slice

Color targets with the SW_4KB_S swizzle (CB_COLOR_ATTRIB3 tile mode 5) are laid out in 4 KiB
blocks with the standard element order the texture detiler uses, and are resident through the
same storage images as 64 KiB targets. A CB_COLOR_VIEW selecting one slice (SLICE_START equal to
SLICE_MAX) renders into that slice: the target starts one slice size per slice after the surface,
the slice size being the surface's mip chain as a texture of the same tile mode lays it out. Views
of several slices are still rejected.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
#505 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp L50

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thanks. Its own commit has exactly the content that passed my PPSA21564 check, on top of #377 (carried unchanged), and it builds and passes ctest here on current main. Ready to merge right after #377. The red Windows job is the guest_audio_in_no_device flake that #532 fixed, so a re-run should clear it.

@oneandonlydean
oneandonlydean merged commit 4db07b3 into boykopovar:main Oct 4, 2026
4 of 5 checks passed
@MichonGoddijn231849
MichonGoddijn231849 deleted the feat/3d-color-targets branch October 9, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants