mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #2038] runtime: respect IndependentBlendEnable=FALSE in B4G4R4A4 stand-in blend fallback #2044
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2044
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2038
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/rt-native-pso-fallback-independent-blend📝 Commits (1)
52d768aruntime: respect IndependentBlendEnable=FALSE in B4G4R4A4 stand-in blend fallback📊 Changes
2 files changed (+90 additions, -5 deletions)
View changed files
📝
runtime/shims/d3d12_xs_native_pso_fallback.h(+20 -5)📝
runtime/test/native_pso_fallback_test.cpp(+70 -0)📄 Description
Coordination item:
RT-NATIVE-PSO-FALLBACK-INDEPENDENT-BLEND(claimed on #1608).Why
In D3D12, when
D3D12_BLEND_DESC::IndependentBlendEnable == FALSE,RenderTarget[0]governs every active render target (0..NumRenderTargets-1) andRenderTarget[1..7]are ignored (typically left zero-initialized by the title).rt::d3d12_xs::native_pipeline_detail::without_stand_in_blend()inruntime/shims/d3d12_xs_native_pso_fallback.hpreviously inspectedRenderTarget[i].BlendEnabledirectly and then setIndependentBlendEnable = TRUEwithout replicatingRenderTarget[0]intoRenderTarget[1..7], causing three bugs wheneverIndependentBlendEnable == FALSE:B4G4R4A4_UNORMand slot 1 isR8G8B8A8_UNORMwithRenderTarget[1]zero-initialized, flippingIndependentBlendEnable = TRUEleaves slot 1 withBlendEnable = FALSEandRenderTargetWriteMask = 0(masking out all colour writes to slot 1).E_NOTIMPL): if slot 0 isR8G8B8A8_UNORMand slot 1 isB4G4R4A4_UNORMwithRenderTarget[0].BlendEnable = TRUEandRenderTarget[1]zero-initialized, slot 1 is effectively blended by D3D12 rules, yetwithout_stand_in_blend()sawRenderTarget[1].BlendEnable == FALSEand returnedfalse.RenderTarget[1..7]: ifRenderTarget[0].BlendEnable == FALSEand ignoredRenderTarget[1].BlendEnable == TRUEon aB4G4R4A4_UNORMtarget, it falsely triggered the fallback even though blending was off.Changes
runtime/shims/d3d12_xs_native_pso_fallback.h: check effective blend (RenderTarget[independent ? i : 0].BlendEnable), replicateRenderTarget[0]toRenderTarget[1..7]before settingIndependentBlendEnable = TRUEwhen!independent, and then turn offBlendEnableonly on activeDXGI_FORMAT_B4G4R4A4_UNORMtargets.runtime/test/native_pso_fallback_test.cpp: add 4 regression cases covering all threeIndependentBlendEnable == FALSEbugs plus distinct per-target write-mask preservation whenIndependentBlendEnable == TRUE.Verification
d3d12.hblend/PSO struct stubs; Windows CTest builds against real Windows SDK headers).runtime/test/native_pso_fallback_test.cppdirectly withclang++ -std=c++20 -Wall -Wextra -Werror:-O1 -g -fsanitize=address,undefined):native_pso_fallback: ok.-O1 -g -fsanitize=thread):native_pso_fallback: ok.-O2):native_pso_fallback: ok.main'sd3d12_xs_native_pso_fallback.h: fails all 3 newIndependentBlendEnable == FALSEregression tests (exit 1).python3 -I scripts/check_no_game_data.py runtime/shims/d3d12_xs_native_pso_fallback.h runtime/test/native_pso_fallback_test.cpp: clean.python3 -I tests/test_text_write_line_endings.py: 3/3 OK.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.