runtime: express CONSTANT_ALPHA on the alpha channel without the alpha blend factor feature #2523
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2531"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Asimmimx on 2026-11-25T20:10:16Z.
Summary
When
AlphaBlendFactorSupportedis false,cb_blend.hnow mapsCONSTANT_ALPHA/ONE_MINUS_CONSTANT_ALPHAin the alpha factor fields toBLEND_FACTOR/INV_BLEND_FACTOR, which mean the same thing on the alpha channel. The new helper isdetail::alpha_factor.ALPHA_FACTORand are still refused without it.ALPHA_FACTOR).Fixes #2528
Tests
startup_cb_blend_decodenow expects this mapping in both alpha slots for every factor value, and for raw word0x74331291without the feature. It adds raw0x72911433, withCONSTANT_ALPHAin the colour fields, which must still be refused.startup_state_block_blendgains a block with separateCONSTANT_ALPHAalpha factors.Windows 11 26300, dev preset:
3 of 3 passed:
startup_cb_blend_decode: 527 cases.startup_state_block_blend: passed.startup_cb_blend_decode_dest_alpha_control(WILL_FAIL): still fails as intended, 26 of 527.Fail-first
With the header reverted and the tests unchanged:
A WARP equivalence check (a source-built scratch program, not added here) read back 0.9000 for both alpha
BLEND_FACTOR/INV_BLEND_FACTORandALPHA_FACTOR/INV_ALPHA_FACTOR, against 0.9 expected.Not run / open
startup_cb_blend_warp/_hardware(they needoffscreen_check). Those draws check only the colour source slot, whose behaviour is unchanged.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:18:32Z.
Review: COMMENTED
Review of head
cfbc4234(comment only, no approval).Code:
detail::alpha_factorincb_blend.hmaps CONSTANT_ALPHA / ONE_MINUS_CONSTANT_ALPHA to BLEND_FACTOR / INV_BLEND_FACTOR in the two alpha slots only when AlphaBlendFactorSupported is false. On the alpha channel those read the constant's alpha, so the meaning is the same.alpha_form()leaves them unchanged, and the colour slots still usefactor()and are still refused without the feature. With the feature on, the output is the same as before. The only blend constant the stubs set isOMSetBlendFactor(slot 21), so there is no separate alpha constant to keep in sync.Checked locally:
cb_blend.hand the two existing blend check files. They extend the existing suites:startup_cb_blend_decodecovers every factor value in both alpha slots plus raw words, andstartup_state_block_blendgets one new block.python3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py,git diff --check origin/main...HEAD: clean.CONSTANT_ALPHAsearch).Notes:
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:23:52Z.
Win2025 WARP receipt for head
1cb88bd3after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
1cb88bd3622ff8ab5efa00ca52306e40b3bd2f2d:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_cb_blend_check startup_state_block_blend_check -- -j 2):32.89s(configure2.48s)ctest --preset dev -R '^(startup_cb_blend|startup_state_block_blend)' --parallel 6 --no-tests=error --output-on-failure): 7/7 passed (0.33s:startup_cb_blend_decode0.03s,startup_state_block_blend0.02s,startup_cb_blend_decode_dest_alpha_control0.02s,startup_cb_blend_swapped_warp0.14s,startup_cb_blend_warp0.13s,startup_cb_blend_hardware0.12s,startup_cb_blend_swapped_hardware0.12s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_cb_blend_check startup_state_block_blend_check -- -j 2):63.51s(configure2.52s)ctest --preset release -R '^(startup_cb_blend|startup_state_block_blend)' --parallel 6 --no-tests=error --output-on-failure): 7/7 passed (0.23s:startup_cb_blend_decode0.03s,startup_state_block_blend0.02s,startup_cb_blend_decode_dest_alpha_control0.01s,startup_cb_blend_swapped_warp0.09s,startup_cb_blend_warp0.10s,startup_cb_blend_hardware0.09s,startup_cb_blend_swapped_hardware0.09s)sccache: 0/10 hits; wall108.9sAI-assisted; commands listed were executed locally.