Repository navigation
fix(agc): render to COLOR_16_16 targets with SWAP_ALT - #15670
Conversation
A two-channel color target with the alternate component order stores the x and w exports in its two channels. COLOR_8_8 already decodes that way; COLOR_16_16 threw "unsupported color format 5 ... component swap 1". Decode it to the same R16G16 formats with the 0xec export mapping, so the existing SWAP_ALT blend handling (split alpha, rejected destination alpha and constant color factors) applies to it, and name the target in those messages by its channel count instead of 8_8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (8 IDs in 531 tests)Skipped (50)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (7, not counted against this PR)Validation IDs already present on main (8 IDs in 531 tests)Skipped (60)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Hi B-Howell, At |
…iting split draws to throw The decode test no longer requires COLOR_16_16 component swaps 2 and 3 to be rejected, and the SWAP_ALT blend test no longer requires a split draw whose vertex shader stores to memory to be rejected. Both are valid behaviour that is not implemented yet, so these checks would fail once it is. The production guards stay; the storing vertex program and its store buffer, used only by the removed check, are dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Done in Removed:
Kept: the production guards, the 16_16 format and channel-mapping checks for number types 0/1/4/7 with swaps 0 and 1, the 16_16 FLOAT split-alpha check, and the 8_8 and 16_16 blend/readback cases. Tested on Windows 11 with WinLibs GCC 15.2.0, Release, on an RTX 4080 SUPER, with |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (13 IDs in 544 tests)Skipped (47)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
BunnyFl
left a comment
There was a problem hiding this comment.
@B-Howell thanks. Treating COLOR_16_16 like COLOR_8_8 here looks right to me. Swap 1 gets the same 0xec mapping 8_8 already uses, and swaps 2 and 3 still fail. The SWAP_ALT handling applies with no format-specific change, because the split decision in Pipeline.cpp and the destination-alpha and constant-colour rejections in State.cpp key on componentMapping == 0xec.
What I ran: head d5c9839460 merged onto main b11c7bf84f, Windows 11, WinLibs GCC, Release, AMD Radeon RX 9070 XT, driver 32.0.32015.12012, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:
agc_driver_graphics,agc_driver_swap_alt_blend,agc_driver_reversed_order_blend,agc_driver_dual_source_blend,agc_driver_uint_color_targetandagc_driver_color_logic_oppass (6 of 6). I didn't find whereagc_driver_unclamped_normalized_blendis registered, so that one isn't in my set;- negative control,
State.cppandPipeline.cpptaken frommainwith the new tests kept:agc_driver_swap_alt_blendandagc_driver_graphicsfail, the other four pass, the same split as yours; - validation comparison (
ctest -V, the same six tests onmainand on the merge): noVUID-and noSYNC-HAZARDIDs on either side, and neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS; tools/check_conventions.py --base upstream/mainon the head: all checks passed;tools/pr_overlap.py --branch: no open PR shares lines. Of the 14 it couldn't compare, the four that touchState.cpporPipeline.cpp(#13928, #13929, #15059, #15548) don't change the 16_16 decode or the SWAP_ALT blend code.
These are AMD results; your description has the NVIDIA ones. Approving.
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (8, not counted against this PR)Validated but not compared (55, not in the main baseline's validation pass)Validation IDs already present on main (8 IDs in 529 tests)Skipped (57)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
Superseabas
left a comment
There was a problem hiding this comment.
Head d5c9839460 merged onto main 6d173c1a19 (clean merge, local only): code read, red/green check and a run on AMD's Windows driver, which the description doesn't cover yet, with an NVIDIA Blackwell run alongside.
Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Release, BUILD_TESTING=ON. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, the description's seven tests (agc_driver_graphics, agc_driver_swap_alt_blend, agc_driver_reversed_order_blend, agc_driver_dual_source_blend, agc_driver_uint_color_target, agc_driver_unclamped_normalized_blend, agc_driver_color_logic_op), ANYPS5_GPU selecting the device (confirmed by Selected GPU):
| GPU | Driver | main |
merged, 3 runs |
|---|---|---|---|
NVIDIA GeForce RTX 5070 Ti (10de:2c05) |
621.01 | 7 of 7 | 7 of 7 each run |
AMD Radeon Graphics, Ryzen 7 7700X iGPU (1002:164e) |
AMD 26.10.2 | 7 of 7 | 7 of 7 each run |
- No
VUID-lines and no missing-layer line in any run.agc_driver_swap_alt_blendprints8_8 and 16_16 SWAP_ALT blend tests passedon both GPUs, so the new 16_16 FLOAT target is drawn and compared on AMD's driver too. - Red check: the merged tree with this PR's
State.cppandPipeline.cppchanges reversed fails on both GPUs.agc_driver_graphicsstops withunsupported color format 5 number type 0 component swap 1, andagc_driver_swap_alt_blendwith... number type 7 component swap 1. That matches the control in the description. check_conventions.py --base mainpasses on the merge.
Read through the change:
- COLOR_16_16 now takes
COMP_SWAP0 and 1, with mapping0xe4or0xec, for the same four number types as before, the way COLOR_8_8 already does. Swaps 2 and 3 stillfail(). - The existing
0xecchecks inDecodeStateand the split inPipeline.cppkey on the mapping, not the format, so they cover 16_16 without other changes. Only the messages and the debt entry change from "8_8" to "two-channel" / "8_8 and 16_16". - Since
d5c9839460the tests no longer require swaps 2 and 3, or the memory-writing split draw, to throw, as requested.
One small thing: the description's Tested section still says agc_driver_graphics "checks that swaps 2 and 3 are rejected". That check was removed in d5c9839460, so that line could go. No code change needed.
AI-assisted: yes (Claude Code)
|
A GFX8 data point: AMD Radeon RX 570 (RADV POLARIS10), Mesa 26.2.5, SteamOS 3.8.28 (Arch distrobox), GCC 16.2.1, Release. Head
The 1,327 AGC, shader, VideoOut and Vulkan tests, once each:
AI-assisted: yes (Claude Code) |
|
Corrected the Tested description to match AI-assisted: yes (Codex). |
|
The refreshed head BunnyFl re-approved the exact head and reported 6/6 on an RX 9070 XT with the head merged onto current main. In their negative control, restoring main's two AGC source files caused the swap-alt and graphics tests to fail. Thanks for checking both arms. TechLevelZero’s independent Ubuntu NVIDIA run built this head merged onto Could a maintainer merge Earlier independent coverage on RX 570 (RADV POLARIS10): ryanc2112 tested d5c9839460 with main b11c7bf84f. Both focused AGC tests passed 3/3 on main and the PR, with zero validation errors. The broader run had the same 14 known failures on both sides. This covers that earlier tested revision. AI-assisted: yes (Codex). |
Co-Authored-By: Codex <noreply@openai.com>
BunnyFl
left a comment
There was a problem hiding this comment.
@B-Howell re-checked at 696430d1f4, and my approval stands.
696430d1f4 is a merge of main (6bf3a19b81) onto d5c9839460, the head I approved. The PR's own +/- lines are identical at both heads in every file it changes: Graphics/src/Pipeline.cpp, Graphics/src/State.cpp, tests/Graphics.cpp, tests/execution/SwapAltBlend.cpp and the debt entry.
What I ran
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0, Release, this head merged onto current main (merge 318e0146e3). The GPU is an AMD Radeon RX 9070 XT (0x1002:0x7550, Vulkan API 0x404167, as the test logs report it). Windows reports driver 32.0.32015.12012, read right after the runs; the logs don't print it. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -V, with the same six tests as at my approval:
- PR:
agc_driver_color_logic_op,agc_driver_dual_source_blend,agc_driver_graphics,agc_driver_reversed_order_blend,agc_driver_swap_alt_blendandagc_driver_uint_color_target: 6 of 6 pass. - Negative control: the same tree with
main'sGraphics/src/Pipeline.cppandGraphics/src/State.cpp.agc_driver_swap_alt_blendandagc_driver_graphicsfail; 4 of 6 pass. - Neither log reports
was not found but was requested by env var VK_INSTANCE_LAYERS. Both have noVUID-and noSYNC-HAZARDIDs. tools/check_conventions.py --base upstream/main --headon this head: all checks pass.tools/pr_overlap.py --branch: no confirmed line overlap with another open PR. The tool couldn't compare the PRs that conflict withmain.
AI-assisted: yes (Claude Code)
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (9 IDs in 594 tests)Skipped (54)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Checked the COLOR_16_16 SWAP_ALT decode ( |
mashingaan
left a comment
There was a problem hiding this comment.
The swap>1 rejection and the 0xe4/0xec mapping for swap 0/1 match the other two-channel formats, and the tests cover both targets plus the separate-alpha-blend split. No findings.
What
A two-channel colour target with
CB_COLOR0_INFO.COMP_SWAP1 (SWAP_ALT) stores the X and W exports in its two channels.DecodeColorFormatRawalready decodes COLOR_8_8 that way, but COLOR_16_16 (CB format 5) accepted onlyCOMP_SWAP0 and threw:The rule does not depend on the channel width. Mesa's
ac_translate_colorswap(src/amd/common/ac_formats.c, mesaeead8dcf02) picks the swap from the channel count alone; for two channels:So COLOR_16_16 with SWAP_ALT now decodes to the same R16G16 format as with swap 0 (UNORM, SNORM, UINT, FLOAT), with export mapping
0xec(X to the first channel, W to the second) in place of0xe4:The existing SWAP_ALT blend handling then covers it: a separate alpha blend is split across the two channels, and destination-alpha and constant-colour factors are rejected. Those messages now say "two-channel color target" instead of "8_8". Swaps 2 and 3 still throw. The debt entry for the SWAP_ALT blend split now names 8_8 and 16_16.
Tested
Windows 11, RTX 4080 SUPER, NVIDIA 621.01, WinLibs GCC 15.2.0-r7, Release. Commit
0ce86e70adon main1c8c0efc8c.agc_driver_graphicsdecodes 16_16 with swaps 0 and 1 for all four number types and checks the split alpha decision.agc_driver_swap_alt_blendnow draws into a real 16_16 FLOAT SWAP_ALT target as well as the 8_8 one, and compares every texel.agc_driver_graphics,agc_driver_swap_alt_blend,agc_driver_reversed_order_blend,agc_driver_dual_source_blend,agc_driver_uint_color_target,agc_driver_unclamped_normalized_blendandagc_driver_color_logic_oppassed 7/7 in each of 3 runs. The run usedANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, LunarG layer 1.4.363.1 throughVK_ADD_LAYER_PATH, andVK_LOADER_DEBUG=layer. The log of each of the six Vulkan tests showsInsert instance layer "VK_LAYER_KHRONOS_validation"in every run.agc_driver_graphicscreates no Vulkan instance.State.cppandPipeline.cppfrom1c8c0efc8cand the new tests kept.agc_driver_swap_alt_blendfails 3/3 withunsupported color format 5 number type 7 component swap 1.agc_driver_graphicsfails 3/3 withunsupported color format 5 number type 0 component swap 1. The other five pass.VUID-lines and 0SYNC-HAZARDlines, so the change adds no validation errors. Neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS.agc_driver_graphicspasses. The six Vulkan tests skip, because WSL has no Vulkan device.unsupported color format 5 number type 7 component swap 1, with 154 presents, all black.std::bad_allocwhile building an oversized sampled view.Checklist
main; no other open PR implements the same functionsNotImplemented_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
Description corrected for
d5c9839460: the rejection-only assertions were removed; the production guards remain. The test results above retain their original source pins.AI-assisted update: Codex.