fix(agc): render 1_5_5_5 targets under every swap and keep DCC variants apart by key bytes #28118
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28118"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by brajankw on 2026-11-28T15:39:54Z.
What
1_5_5_5 colour targets render into A1R5G5B5 under all four component swaps. STD, ALT, STD_REV and ALT_REV fill XYZW with RGBA, BGRA, ABGR and ARGB, following
ac_translate_colorswapin Mesa 26.2.2 ac_formats.c. Write masks and blend constants use the same mapping.gfx8_get_dcc_clear_parameters.main: the only channel is alpha. A float or normalized storage image cleared directly keeps it as colour, as onmain. R8_SNORM and R8_SINT gain a DCC layout and decode the same way. The GFX10 colour-or-alpha rule for one-channel formats is left to #28192.main, the per-use partial walk leaves them unchanged.Overlaps #27829. That PR maps SWAP_ALT only, which this PR also covers. Both change the
1_5_5_5 color targetsdebt entry, so whichever lands second rebases its fragment.Tested
Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 4070 SUPER, driver 621.24. Base
8970cd2cfd, changea5cd07a21b.Full AGC set (
agc_driver|agc_shader|texture_dcc|initial_texture_dcc|sample_multisample,-j 4): 1775/1778 pass.agc_driver_gcn_indirect_draw_location,agc_driver_label_ordered_flushandagc_driver_linear_target_import_creation.agc_driver_image_table_variantspasses in all four modes: default,fast_revalidate,pending_copy_tailandtable_index.Validation A/B. Both sides ran with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer, validation layer 1.4.363,ctest --test-dir build -R <pattern> -V. The pattern covers colour 1_5_5_5, image table variants, sample multisample, alpha-to-coverage, graphics, recorder, restored DCC keys and the DCC texture tests.VUID-The change side also runs the six tests this PR adds:
agc_driver_dcc_restored_keys(plain,no_key_fast_pathandno_epoch_revalidate) and thefast_revalidate,pending_copy_tailandtable_indexmodes ofagc_driver_image_table_variants.Review follow-ups (
a5cd07a21b..7f57e65a82), with the branch merged withmaind71093d47de. The variables and layer are the same as above.agc_pending_key_storesandagc_storage_pending_key_refresh: 36/37 pass.texture_format_lookuphas no command and is Not Run on both sides. The layer is inserted 33 times, with 0 "was not found" and 0VUID-.mainon the same set without the recorder tests: 28/28, 0VUID-.a5cd07a21b,agc_pending_key_storesfails with "DCC clear code 0001 of a one-channel format (VkFormat 70) is not implemented".ClearColorFor, the R8 key fill case inagc_driver_recorderfails ("did not store 0 in the only channel of an R8 surface").RunZeroKeyRepresentativeruns only where R32G32B32_SFLOAT can be sampled and uploaded with optimal tiling, so it skips on the RTX 4070. A red result reported on the parent branch came from a run before that skip existed. The format-support gap, an optimal-tiled R32G32B32 image created without asking the device, is recorded in debt.AMD:
RunPendingTailskips with code 77 whenminStorageBufferOffsetAlignmentis 4 or less, which is typical on AMD, because the key store is then bound in place. An AMD run therefore does not exercise that case.The export direction, and which field each blend constant reaches, are not measured on a PS5.
Checklist
main; no other open PR implements the same functions (except #27829, which maps SWAP_ALT only; see What)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-28T15:51:45Z.
Review: COMMENTED
Actionable comments posted: 2
819b8948-0d67-4bd2-ab63-e5a5f53b2c94Reviewing files that changed from the base of the PR and between
bb89b8a4f5anda5cd07a21b.core/libs/prx/libSceAgcDriver/Graphics/include/DccMetadata.hppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestTextureResource.hppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/include/TextureFormat.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/TextureFormat.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/TextureFormat.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_variants_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/Color1555Target.cppcore/libs/prx/libSceAgcDriver/tests/execution/DccKeyPresync.cppcore/libs/prx/libSceAgcDriver/tests/execution/DccKeysFirstWrite.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTableVariants.cppcore/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppdocs/dev/debt/changes/agc-color-1-5-5-5-swaps.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T16:09:33Z.
Review: COMMENTED
Reviewed — comments
The available evidence does not justify a formal decision: I reviewed the prepared diff and targeted source context, but did not read every added line or run checks.
What I ran
a5cd07a21b04910ddcab1dee7725b07fa130f5ca.Results
Findings
Blocking
None identified in the portions reviewed.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/Recorder.cpp; the reader was not used to inspect all their changed lines.review/description.md,review/commits.md,review/manifest.json,review/README.md, and portions ofreview/diff.patch. Repository context was read throughrepo_read.pyfor selected changed code; not all changed files or added lines were read.To get this to a good state
Nothing is required. Optional: complete the review of the remaining changed lines and run relevant checks before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T06:44:33Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the code inspected; the reported test results are author supplied and were not run during this review.
What I ran
Reviewed head
7f57e65a82d95d37accf892b1861c631b35b8bebusingrepo_read.pyto inspect the prepared description, commits, manifest, diff, and targeted changed code. No tests or build commands were run.Results
Findings
Blocking
None in the code inspected.
Non-blocking
None.
Not verified
The full text of
ShaderResources.cpp,Texture.cpp,Graphics.cpp, andRecorder.cppwas accessed only in targeted ranges; other changed files were not read. The manifest lists 21 changed files as included and 4 excluded by size; only a subset of included files was inspected. Hardware behavior, PS5 behavior, and author reported test results were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T12:44:58Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the results and unverified areas are listed below.
What I ran
Reviewed head
f1480c02237a3555424e7281ac39a7cb5d53da6afrom the prepared diff and targeted source reads throughrepo_read.py. No commands, builds, or tests were run by me.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior claims were checked against the prepared diff and repository files at the pinned head. Relevant sources include State.cpp, ShaderResources.cpp, Texture.cpp, and MultisampleTarget.cpp.
Not verified
Builds and tests were not run. The description reports test results on Windows 11 Pro 10.0.26200 with an NVIDIA RTX 4070 SUPER, driver 621.24; those are author-reported, not independently verified. PS5 behavior and the stated Mesa-derived component and clear mappings were not independently verified. Full text was not included for
ShaderResources.cpp,Texture.cpp,Graphics.cpp, andRecorder.cpp; targeted changed ranges were read through the pinned reader. Other changed files and excluded files were not read in full.files.jsonwas not available as a review document; the reader’s file listing showed the changed-file inclusion status.To get this to a good state
Nothing is required. Optional: run the reported test set on the final head and verify console behavior when hardware is available.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T12:49:18Z.
Review: COMMENTED
Actionable comments posted: 3
281e747d-93f5-4acf-8c00-1b60b4f90f90Reviewing files that changed from the base of the PR and between
7f57e65a82andf1480c0223.core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/include/TextureFormat.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/TextureFormat.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/TextureFormat.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTableVariants.cppcore/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T16:31:38Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected diff and source sections show no verified blocking defect, but the review is incomplete because several changed files were not read in full.
What I ran
Reviewed head
957cdbd0f794a3ef21d900dcf49be9b7cb558ab0using the prepared review bundle and the pinnedrepo_read.pyreader. No tests or build commands were run.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Sources
Reviewed the prepared diff and pinned source at
957cdbd0f794a3ef21d900dcf49be9b7cb558ab0; no external behavior claims are made.Not verified
The full text of these changed files was not read:
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp,core/libs/prx/libSceAgcDriver/tests/Graphics.cpp, andcore/libs/prx/libSceAgcDriver/tests/Recorder.cpp. Targeted sections ofShaderResources.cppand its diff were inspected. Other included changed files were identified from the review folder listing but not all were read in full. Tests, build, hardware behavior, and the reported author/CI results were not independently verified.To get this to a good state
Nothing is required. Optional: complete review of the unread changed-file sections and run the relevant checks on this head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T00:17:16Z.
Review: COMMENTED
Reviewed — comments
The targeted source inspection found no concrete defect, but this review is incomplete because most changed files were not read in full.
What I ran
Reviewed head
06839f4ef12900c005bda891530258501db8522ausing the prepared diff and targetedrepo_read.py catcalls. No tests, builds, or other checks were run.Results
Findings
Blocking
No finding raised from the portions inspected.
Non-blocking
No additional feedback from the portions inspected.
Not verified
The prepared materials included 23 changed files. I read selected source ranges in
State.cpp,DccMetadata.cpp,ShaderResources.cpp,Texture.cpp, andTextureFormat.cpp, plus test snippets fromtests/TextureFormat.cppandtests/execution/Color1555Target.cpp. I did not fully read the remaining changed-file bodies. The manifest marks the full texts ofShaderResources.cpp,Texture.cpp,tests/Graphics.cpp, andtests/Recorder.cppas excluded from the review folder; only targeted ranges of the first two were read through the pinned reader. Console behavior and the author-reported test results were not independently verified.To get this to a good state
Nothing is required from the author for this comment; review coverage was limited.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T00:27:58Z.
Review: COMMENTED
Actionable comments posted: 5
f7b8283f-c451-4cfd-b636-cb668fe41ba2Reviewing files that changed from the base of the PR and between
957cdbd0f7and06839f4ef1.core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTableVariants.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T05:10:05Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
949d50bd77df06eb4eb8981e6c99d2d19240e0b7using the prepared diff and targeted source reads throughrepo_read.py. No tests, builds, or merged preview were run.Results
files.jsonFindings
Blocking
None verified.
Non-blocking
ShaderResources.cpp,Texture.cpp,Graphics.cpp, andRecorder.cppwere only reviewed in targeted sections. The remaining changed-file context and behavior should be checked before treating this as a complete review.Sources
Not verified
The full contents and behavior of the changed files were not reviewed. Targeted sections were read in
DccMetadata.cpp,Draw.cpp,MultisampleTarget.cpp,ShaderResources.cpp,State.cpp,Texture.cpp, and the prepared diff; the full text of the oversized files was not available infiles/. No independent test, build, hardware, or PS5 behavior was verified. The author-reported test results in the PR description were not run by this review.To get this to a good state
Nothing is required. Optional: complete review of the remaining changed-file sections before relying on this review as a full audit.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:46:08Z.
Review: COMMENTED
RunZeroKeyRepresentativeskips when optimalR32G32B32_SFLOATsampling and upload are unavailable. The debt entry records that lavapipe exposes those format features but the 12-byte detiler rejects the upload. Could the zero-key case be registered separately or use an admitted texture layout so the rest of the table-variant checks can finish on that configuration?Source review at
949d50bd77. The head trial-merges onto700fae9438. Paired Vulkan execution is queued.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.