Skip to content

fix(agc): drop pixel shader exports past the draw's attachments - #135

Merged
boykopovar merged 1 commit into
boykopovar:mainfrom
oneandonlydean:fix/agc-drop-exports-past-attachments
Sep 30, 2026
Merged

boykopovar merged 1 commit into
boykopovar:mainfrom
oneandonlydean:fix/agc-drop-exports-past-attachments

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

What

A pixel shader may export MRT slots the draw has no color attachment for, for example MRT1 when CB_TARGET_MASK & CB_SHADER_MASK enables only slot 0. The color backend drops those exports. Vulkan also discards a fragment output that has no attachment. But ValidateShaders rejected the whole draw with "fragment shader must export float4 colors at locations below the attachment count".

Outputs at or past the attachment count are now left out of the returned written locations. Only exports that reach an attachment must still be float4; otherwise validation throws "fragment shader must export float4 colors to its attachments".

Tested

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: test(agc): link agc_driver_graphics_tests again, run it under ctest and bring its stale expectations up to date #113 (to build the test target)
  • AI-assisted: yes

An MRT export to a slot past the draw's color attachments (outside
CB_TARGET_MASK & CB_SHADER_MASK, e.g. MRT1 with only slot 0 enabled) is
dropped by the color backend. Vulkan discards a fragment output without
an attachment the same way, but validation rejected the draw ("fragment
shader must export float4 colors at locations below the attachment
count"). Such outputs are now left out of the written locations, and
only the exports that reach an attachment must be float4.
@oneandonlydean
oneandonlydean marked this pull request as draft September 29, 2026 01:56
@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

Moving this to draft: in a game test, the change it comes from blanks Astro Bot's intro. I'm narrowing down which part is responsible and will update or close this PR.

@oneandonlydean
oneandonlydean marked this pull request as ready for review September 29, 2026 02:27
@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

Ready again. A bisect traced the blank intro to a different change (the pixel-input slot mapping, #137), not this one.

@github-actions github-actions Bot added the agc libSceAgc* label Sep 29, 2026
@oneandonlydean
oneandonlydean force-pushed the fix/agc-drop-exports-past-attachments branch from 7a59c67 to 2b0fa0b Compare September 30, 2026 11:12
@boykopovar
boykopovar merged commit 1c1d8fb into boykopovar:main Sep 30, 2026
3 checks passed
@oneandonlydean
oneandonlydean deleted the fix/agc-drop-exports-past-attachments 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*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants