[PR #2023] d3d12: an integer render target bypasses its blender (D3D-INTEGER-TARGET-BLEND-BYPASS) #2029

Open
opened 2026-11-26 21:19:47 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2023
Author: @BubsMcgee
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/integer-target-blend-bypass


📝 Commits (1)

  • 8536bcb d3d12: an integer render target bypasses its blender

📊 Changes

2 files changed (+58 additions, -2 deletions)

View changed files

📝 runtime/shims/d3d12_vulkan_device.cpp (+34 -2)
📝 runtime/test/d3d12_pso_validation_test.cpp (+24 -0)

📄 Description

Ports the first concrete gap from DexNom/VIctory (source-only Rust runtime,
GPL-3.0-or-later), commit ddb7332, reimplemented for this Vulkan layer.

What

  • A render target whose format is integer no longer gets blendEnable = VK_TRUE. The layer clears the enable for
    that target only, keeps its colorWriteMask (and every other target's state), and no longer counts it as a
    dual-source consumer.
  • The console's native state keeps CB_BLENDn regardless of the format, and D3D12Xbox bypasses the blender on
    integer surfaces. PC D3D12 rejects that state at pipeline creation, and Vulkan requires
    blendEnable = VK_FALSE (VUID-VkPipelineColorBlendAttachmentState-blendEnable-04727), so forwarding it could
    only fail the pipeline — the failed-CreatePipelineState class reported on RADV in #1915.

Test

  • d3d12_pso_validation_test §3b creates a layer-only pipeline with an R8G8B8A8_UINT target, blending enabled
    and a red write mask. PC D3D12 rejects the same state, so it is deliberately not in the parity set.
  • Windows 11, RTX 3080 Ti, driver 616.64: PASS (61 layer checks, 100 host comparisons), with the plain run and
    with LEONIDA_VK_VALIDATION=1.

Attribution

Adapted from DexNom/VIctory ddb7332 (GPL-3.0-or-later), "Restore 40 shader variants and repair integer-target
blending"; noted in the code comment. AI-assisted.

Claimed as D3D-INTEGER-TARGET-BLEND-BYPASS in the coordination issue.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2023 **Author:** [@BubsMcgee](https://github.com/BubsMcgee) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/integer-target-blend-bypass` --- ### 📝 Commits (1) - [`8536bcb`](https://github.com/ubiquitarianism/leonida/commit/8536bcb4e387c2fbf169e8743b33bcdc83e7fae5) d3d12: an integer render target bypasses its blender ### 📊 Changes **2 files changed** (+58 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+34 -2) 📝 `runtime/test/d3d12_pso_validation_test.cpp` (+24 -0) </details> ### 📄 Description Ports the first concrete gap from [DexNom/VIctory](https://github.com/DexNom/VIctory) (source-only Rust runtime, GPL-3.0-or-later), commit `ddb7332`, reimplemented for this Vulkan layer. ## What - A render target whose format is integer no longer gets `blendEnable = VK_TRUE`. The layer clears the enable for that target only, keeps its `colorWriteMask` (and every other target's state), and no longer counts it as a dual-source consumer. - The console's native state keeps `CB_BLENDn` regardless of the format, and D3D12Xbox bypasses the blender on integer surfaces. PC D3D12 rejects that state at pipeline creation, and Vulkan requires `blendEnable = VK_FALSE` (VUID-VkPipelineColorBlendAttachmentState-blendEnable-04727), so forwarding it could only fail the pipeline — the failed-`CreatePipelineState` class reported on RADV in #1915. ## Test - `d3d12_pso_validation_test` §3b creates a layer-only pipeline with an `R8G8B8A8_UINT` target, blending enabled and a red write mask. PC D3D12 rejects the same state, so it is deliberately not in the parity set. - Windows 11, RTX 3080 Ti, driver 616.64: `PASS (61 layer checks, 100 host comparisons)`, with the plain run and with `LEONIDA_VK_VALIDATION=1`. ## Attribution Adapted from DexNom/VIctory `ddb7332` (GPL-3.0-or-later), "Restore 40 shader variants and repair integer-target blending"; noted in the code comment. AI-assisted. Claimed as `D3D-INTEGER-TARGET-BLEND-BYPASS` in the coordination issue. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#2029
No description provided.