AMD Vega (Windows, driver 23.19): clears of multisampled B8G8R8A8 color targets swap red and blue; agc_driver_msaa_dcc_srgb_clear_2/_4/_8 fail #25521

Closed
opened 2026-11-22 07:10:33 +00:00 by cryst4lpepsi · 0 comments
cryst4lpepsi commented 2026-11-22 07:10:33 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by cryst4lpepsi on 2026-11-22T07:10:33Z.


What happens

agc_driver_msaa_dcc_srgb_clear_2, _4 and _8 fail on an AMD Vega iGPU with AMD's Windows driver 23.19: AGC graphics: an sRGB DCC import or resolve changed an undrawn sample endpoint. They pass on an NVIDIA GPU in the same laptop.

With the expected and actual bytes printed (a local test-only change), only B8G8R8A8_SRGB fails, and only for the DCC clear keys 0x40 (Clear0001) and 0x80 (Clear1110), with dccAlphaOnMsb false. Red and blue are swapped in the resolved texels:

Samples Format Key Got (bytes) Expected (bytes)
2, 4, 8 B8G8R8A8_SRGB 0x40 00 00 ff 00 ff 00 00 00
2, 4, 8 B8G8R8A8_SRGB 0x80 ff ff 00 ff 00 ff ff ff

R8G8B8A8_SRGB passes for every key. Keys 0x00 and 0xc0 clear red and blue to the same value, so a swap cannot show for them.

What was checked

Both GPUs take the same AnyPS5 path. With temporary prints in MultisampleTarget.cpp and in the ColorMetadataPass::Mode::Resolve branch of RunColorMetadataPass:

  • The multisampled target: format 50 (B8G8R8A8_SRGB), storageFormat 44 (B8G8R8A8_UNORM), storageImageMultisample 1, sampleable, on both GPUs.
  • The resolve destination: format 50, host storage 44, source 50, on both GPUs.

So the same Vulkan route gives swapped red and blue only on the AMD driver.

Two local experiments (not proposed) isolate the step:

Change AMD Vega NVIDIA
main fails (red and blue swapped) passes
Resolve through the B8G8R8A8_UNORM twin views instead of B8G8R8A8_SRGB still fails passes
Red and blue swapped in the VkClearColorValue of the three vkCmdClearColorImage calls in MultisampleTarget.cpp, for B8G8R8A8 targets only passes fails

So the resolve is not involved: AMD's 23.19 driver clears the multisampled B8G8R8A8 image with red and blue swapped.

Three more local experiments show the swap does not depend on how the clear is issued or how the image is created:

Change AMD Vega NVIDIA
The three clears replaced by a render pass with VK_ATTACHMENT_LOAD_OP_CLEAR over the target's view (Khronos validation: no VUID- messages) still swapped passes
No sRGB twin (twinFormat undefined) still swapped passes
No twin and no storage form (storageFormat undefined), so the image is created without VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT still swapped passes

Not tried: another AMD driver, a single-sample B8G8R8A8 clear, and a clear written by a draw instead of a clear operation.

Title, test or build step

agc_driver_msaa_dcc_srgb_clear_2, agc_driver_msaa_dcc_srgb_clear_4, agc_driver_msaa_dcc_srgb_clear_8 (agc_driver_alpha_to_coverage_tests --dcc-srgb-clear <samples>).

AnyPS5 commit

main a1b89f35e2, nothing merged on top.

System

Windows 11 Home 22621, WinLibs GCC 15.2.0 r7, Release. AMD Radeon(TM) Graphics (Vega iGPU, 1002:1638, subgroup 64), AMD proprietary driver 23.19.10.08. Control: NVIDIA GeForce RTX 3050 Ti Laptop GPU (10de:25a0), driver 596.36, all three pass.

Steps to reproduce

ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R "^agc_driver_msaa_dcc_srgb_clear_(2|4|8)$" -V

Log

AGC graphics: an sRGB DCC import or resolve changed an undrawn sample endpoint

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6539681807 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/25521). Originally posted by [cryst4lpepsi](https://github.com/cryst4lpepsi) on 2026-11-22T07:10:33Z. --- ### What happens `agc_driver_msaa_dcc_srgb_clear_2`, `_4` and `_8` fail on an AMD Vega iGPU with AMD's Windows driver 23.19: `AGC graphics: an sRGB DCC import or resolve changed an undrawn sample endpoint`. They pass on an NVIDIA GPU in the same laptop. With the expected and actual bytes printed (a local test-only change), only `B8G8R8A8_SRGB` fails, and only for the DCC clear keys `0x40` (`Clear0001`) and `0x80` (`Clear1110`), with `dccAlphaOnMsb` false. Red and blue are swapped in the resolved texels: | Samples | Format | Key | Got (bytes) | Expected (bytes) | |---|---|---|---|---| | 2, 4, 8 | `B8G8R8A8_SRGB` | `0x40` | `00 00 ff 00` | `ff 00 00 00` | | 2, 4, 8 | `B8G8R8A8_SRGB` | `0x80` | `ff ff 00 ff` | `00 ff ff ff` | `R8G8B8A8_SRGB` passes for every key. Keys `0x00` and `0xc0` clear red and blue to the same value, so a swap cannot show for them. ### What was checked Both GPUs take the same AnyPS5 path. With temporary prints in `MultisampleTarget.cpp` and in the `ColorMetadataPass::Mode::Resolve` branch of `RunColorMetadataPass`: - The multisampled target: `format 50` (`B8G8R8A8_SRGB`), `storageFormat 44` (`B8G8R8A8_UNORM`), `storageImageMultisample 1`, sampleable, on both GPUs. - The resolve destination: `format 50`, host storage `44`, source `50`, on both GPUs. So the same Vulkan route gives swapped red and blue only on the AMD driver. Two local experiments (not proposed) isolate the step: | Change | AMD Vega | NVIDIA | |---|---|---| | `main` | fails (red and blue swapped) | passes | | Resolve through the `B8G8R8A8_UNORM` twin views instead of `B8G8R8A8_SRGB` | still fails | passes | | Red and blue swapped in the `VkClearColorValue` of the three `vkCmdClearColorImage` calls in `MultisampleTarget.cpp`, for `B8G8R8A8` targets only | passes | fails | So the resolve is not involved: AMD's 23.19 driver clears the multisampled `B8G8R8A8` image with red and blue swapped. Three more local experiments show the swap does not depend on how the clear is issued or how the image is created: | Change | AMD Vega | NVIDIA | |---|---|---| | The three clears replaced by a render pass with `VK_ATTACHMENT_LOAD_OP_CLEAR` over the target's view (Khronos validation: no `VUID-` messages) | still swapped | passes | | No sRGB twin (`twinFormat` undefined) | still swapped | passes | | No twin and no storage form (`storageFormat` undefined), so the image is created without `VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT` | still swapped | passes | Not tried: another AMD driver, a single-sample `B8G8R8A8` clear, and a clear written by a draw instead of a clear operation. ### Title, test or build step `agc_driver_msaa_dcc_srgb_clear_2`, `agc_driver_msaa_dcc_srgb_clear_4`, `agc_driver_msaa_dcc_srgb_clear_8` (`agc_driver_alpha_to_coverage_tests --dcc-srgb-clear <samples>`). ### AnyPS5 commit `main` `a1b89f35e2`, nothing merged on top. ### System Windows 11 Home 22621, WinLibs GCC 15.2.0 r7, Release. AMD Radeon(TM) Graphics (Vega iGPU, `1002:1638`, subgroup 64), AMD proprietary driver 23.19.10.08. Control: NVIDIA GeForce RTX 3050 Ti Laptop GPU (`10de:25a0`), driver 596.36, all three pass. ### Steps to reproduce ``` ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R "^agc_driver_msaa_dcc_srgb_clear_(2|4|8)$" -V ``` ### Log ``` AGC graphics: an sRGB DCC import or resolve changed an undrawn sample endpoint ``` AI-assisted: yes
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#25521
No description provided.