AGC: pipelines use differing per-attachment blend states while independentBlend is never enabled (VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605) #11990

Closed
opened 2026-10-27 15:40:19 +00:00 by maskym · 0 comments
maskym commented 2026-10-27 15:40:19 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by maskym on 2026-10-27T15:40:19Z.


What happens

With the Khronos validation layer loaded, main reports VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 18 times across the agc* tests: graphics pipelines are created with differing per-attachment blend states while the independentBlend device feature is never enabled. The tests pass; the layer only reports the violation.

Title, test or build step

agc_driver_prepared_exports (14 occurrences) and agc_driver_srgb8_color_target (4 occurrences), from ctest --test-dir build -R '^(agc|guest_video_out|video_out)' --parallel 4 -V. No title involved.

AnyPS5 commit

2ee8e9751a

System

Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER (vendor 0x10de, device 0x1e84), Vulkan loader 1.4.357 from the NVIDIA driver, Khronos Validation Layers nightly 1.4.366 (commit b2b44c0d37, 2026-10-27), WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh), Release, BUILD_TESTING=ON.

Steps to reproduce

VK_ADD_LAYER_PATH=<validation layer directory>
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation
ANYPS5_REQUIRE_VULKAN=1
ANYPS5_NO_SHADER_CACHE=1
ctest --test-dir build -R '^(agc_driver_prepared_exports|agc_driver_srgb8_color_target)$' -V

The full ^(agc|guest_video_out|video_out) set gives 1125/1125 passed (9 skipped), 146 s, no was not found but was requested by env var VK_INSTANCE_LAYERS, and this is the only VUID- reported. CI runs these tests on lavapipe only and did not show it.

Log

1217: Validation Error: [ VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 ] | MessageID = 0xcb4717d3
1217: vkCreateGraphicsPipelines(): pCreateInfos[0].pColorBlendState->pAttachments[1] is different than pAttachments[0] and independentBlend feature was not enabled.
1217: The Vulkan spec states: If the independentBlend feature is not enabled, all elements of pAttachments must be identical (https://docs.vulkan.org/spec/latest/chapters/framebuffer.html#VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605)

(1217 is agc_driver_prepared_exports; agc_driver_srgb8_color_target prints the same message.)

What was checked

  • core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp (around lines 1797-1817) enables depthClamp, fillModeNonSolid, depthBounds, depthBiasClamp, dualSrcBlend, logicOp and others from available, but not independentBlend; the identifier occurs nowhere under core/.
  • The driver builds one VkPipelineColorBlendAttachmentState per color target (Graphics::State::blends) and passes the whole vector as pAttachments in core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp lines 676-700. These states legitimately differ: Graphics/src/Draw.cpp maskedState (lines 2422-2430) zeroes colorWriteMask of the targets the pixel shader has no output for, so a two-MRT draw whose shader writes one target produces differing attachments; Pipeline.cpp lines 682-693 give the second channel of an 8_8 target its own factors and ops; and the guest sets CB_BLENDn_CONTROL per render target.
  • The draw cache already compares blend states per attachment (Execution/src/Driver/Draw/DrawRegisterKey.cpp sameBlend, line 233), so the driver treats them as independent everywhere except at device creation.
  • The same VUID was raised in #10634 against PR #10351's attachment fallback, which then added a guard in that PR; main has no such guard.
  • A fix would enable independentBlend when the device offers it, record it in the graphics context next to dualSrcBlend and logicOp (Graphics/include/Context.hpp lines 213-216), and Require identical attachments when it is absent, as Pipeline.cpp lines 468-469 do for dualSrcBlend.

AI-assisted: yes (Claude Code); the runs, the numbers and the line references above were checked on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6062543384 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/11990). Originally posted by [maskym](https://github.com/maskym) on 2026-10-27T15:40:19Z. --- ### What happens With the Khronos validation layer loaded, `main` reports `VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605` 18 times across the `agc*` tests: graphics pipelines are created with differing per-attachment blend states while the `independentBlend` device feature is never enabled. The tests pass; the layer only reports the violation. ### Title, test or build step `agc_driver_prepared_exports` (14 occurrences) and `agc_driver_srgb8_color_target` (4 occurrences), from `ctest --test-dir build -R '^(agc|guest_video_out|video_out)' --parallel 4 -V`. No title involved. ### AnyPS5 commit `2ee8e9751a` ### System Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER (vendor 0x10de, device 0x1e84), Vulkan loader 1.4.357 from the NVIDIA driver, Khronos Validation Layers nightly 1.4.366 (commit b2b44c0d37, 2026-10-27), WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh), Release, `BUILD_TESTING=ON`. ### Steps to reproduce ``` VK_ADD_LAYER_PATH=<validation layer directory> VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^(agc_driver_prepared_exports|agc_driver_srgb8_color_target)$' -V ``` The full `^(agc|guest_video_out|video_out)` set gives 1125/1125 passed (9 skipped), 146 s, no `was not found but was requested by env var VK_INSTANCE_LAYERS`, and this is the only `VUID-` reported. CI runs these tests on lavapipe only and did not show it. ### Log ``` 1217: Validation Error: [ VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 ] | MessageID = 0xcb4717d3 1217: vkCreateGraphicsPipelines(): pCreateInfos[0].pColorBlendState->pAttachments[1] is different than pAttachments[0] and independentBlend feature was not enabled. 1217: The Vulkan spec states: If the independentBlend feature is not enabled, all elements of pAttachments must be identical (https://docs.vulkan.org/spec/latest/chapters/framebuffer.html#VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605) ``` (1217 is `agc_driver_prepared_exports`; `agc_driver_srgb8_color_target` prints the same message.) ### What was checked - `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` (around lines 1797-1817) enables `depthClamp`, `fillModeNonSolid`, `depthBounds`, `depthBiasClamp`, `dualSrcBlend`, `logicOp` and others from `available`, but not `independentBlend`; the identifier occurs nowhere under `core/`. - The driver builds one `VkPipelineColorBlendAttachmentState` per color target (`Graphics::State::blends`) and passes the whole vector as `pAttachments` in `core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp` lines 676-700. These states legitimately differ: `Graphics/src/Draw.cpp` `maskedState` (lines 2422-2430) zeroes `colorWriteMask` of the targets the pixel shader has no output for, so a two-MRT draw whose shader writes one target produces differing attachments; `Pipeline.cpp` lines 682-693 give the second channel of an 8_8 target its own factors and ops; and the guest sets `CB_BLENDn_CONTROL` per render target. - The draw cache already compares blend states per attachment (`Execution/src/Driver/Draw/DrawRegisterKey.cpp` `sameBlend`, line 233), so the driver treats them as independent everywhere except at device creation. - The same VUID was raised in #10634 against PR #10351's attachment fallback, which then added a guard in that PR; `main` has no such guard. - A fix would enable `independentBlend` when the device offers it, record it in the graphics context next to `dualSrcBlend` and `logicOp` (`Graphics/include/Context.hpp` lines 213-216), and `Require` identical attachments when it is absent, as `Pipeline.cpp` lines 468-469 do for `dualSrcBlend`. AI-assisted: yes (Claude Code); the runs, the numbers and the line references above were checked on this machine.
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#11990
No description provided.