Skip to content

feat(agc): implement 10_11_11 unorm color targets through 32-bit uint attachments - #1485

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Celegans12:feat/agc-10-11-11-unorm-color-targets
Oct 10, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Celegans12:feat/agc-10-11-11-unorm-color-targets

Conversation

@Celegans12

@Celegans12 Celegans12 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What

Color targets with CB_COLOR_INFO format 6 (COLOR_10_11_11) and NUMBER_UNORM throw unsupported color format 6 number type 0 component swap 0; Vulkan has no unorm 11_11_10 format.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main f145139: configure -DBUILD_TESTING=ON, full build, --target libs, ctest:
  • 489/489 tests pass (ctest --output-on-failure)
  • Linux (WSL Ubuntu 24.04, GCC 13.3, Mesa llvmpipe, upstream's job configuration), merged with main f145139: 498/498 pass
  • New agc_driver_packed_unorm_color_target draws through the registered pixel shader (tiled and linear; 32_ABGR and FP16_ABGR; ties, NaN, infinities) and checks exact words. It fails with the packing in the static key (unregistered program is not a compute shader) or out of the module key.
  • unorm10_11_11TargetTests (agc_driver_graphics): one artifact, two specializations. agc_shader_memory: version 1-13 requests decode unpacked. None of the three builds on main.
  • Not tested: console behaviour.

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 (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

@github-actions github-actions Bot added shader core/shader docs agc libSceAgc* labels Oct 8, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 8, 2026
@Celegans12
Celegans12 force-pushed the feat/agc-10-11-11-unorm-color-targets branch from 48f4ab5 to 56b02cb Compare October 8, 2026 12:01
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 8, 2026
@Celegans12
Celegans12 force-pushed the feat/agc-10-11-11-unorm-color-targets branch from 56b02cb to b09b30e Compare October 8, 2026 13:54
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 8, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 8, 2026
@Celegans12
Celegans12 force-pushed the feat/agc-10-11-11-unorm-color-targets branch from b09b30e to c89538f Compare October 8, 2026 20:06
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 8, 2026
@Celegans12
Celegans12 force-pushed the feat/agc-10-11-11-unorm-color-targets branch from c89538f to d41f24f Compare October 9, 2026 03:20
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 9, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on current main: the only conflict was with #1073 in ShaderValidation.cpp (uintExport vs packed in the same check). I merged both conditions (a target expects u32x4 if either applies, each with its own message) and rebased. Build + ctest of libSceAgcDriver green (267/267); the new tests don't compile without the change and agc_driver_packed_unorm_color_target passes.

Unmodelled cases still throw and the CB-rounding assumption is recorded in TechnicalDebt. Merging once CI is green on the rebased head.

@adriadam10
adriadam10 force-pushed the feat/agc-10-11-11-unorm-color-targets branch from d41f24f to 1e92722 Compare October 9, 2026 23:57
… attachments

CB_COLOR_INFO format 6 (COLOR_10_11_11) with NUMBER_UNORM threw in
DecodeColorFormat: Vulkan has only the B10G11R11 float format. Such a
target now renders into an R32_UINT attachment in the layout of
format-30 images (unorm11 R and G in bits 0-21, unorm10 B in bits
22-31), so later image loads of the surface read the same words.

The target format is draw state, so the packing is a specialization of
the registered pixel shader: every float MRT export also computes the
packed word (EmitFormatStoreComponent) behind specialization constant
ExportPackingBase + target, and the specialized module turns a packed
target's output into a uint4 that ValidateShaders expects. The new
request field targetExportPacking is in the module key, the result memo,
the draw key and the serialized request (version 14). Blending, partial
RGB writes, UNORM16/SNORM16/UINT16 exports, DCC and ROUND_MODE throw.
@Celegans12
Celegans12 force-pushed the feat/agc-10-11-11-unorm-color-targets branch from 1e92722 to c4b7a74 Compare October 10, 2026 00:19
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 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
#1607 docs/dev/TechnicalDebt.md L332-333

@github-actions github-actions Bot added the build label Oct 10, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on current main: build + ctest of libSceAgcDriver/libSceAgc green, the new tests don't compile without the change, agc_driver_packed_unorm_color_target draws through the registered pixel shader on lavapipe, unmodelled cases still throw, the CB-rounding assumption is in TechnicalDebt. Merging once the full Linux/Windows build (dispatched manually) is green.

@adriadam10
adriadam10 merged commit 29b4429 into boykopovar:main Oct 10, 2026
8 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
…unorm-color-targets

feat(agc): implement 10_11_11 unorm color targets through 32-bit uint attachments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants