Repository navigation
d3d12: enable OPTIONS13 AlphaBlendFactorSupported and validate blend/logic-op state - #8043
Sakura-Byte wants to merge 1 commit into
Conversation
|
Tested 1223c42 on Windows 11, MSVC 2022 BuildTools, AMD RX 9060 XT (driver 32.0.32015.7029), RelWithDebInfo/Ninja. Built and ran the three touched test binaries:
Code read of
AI-assisted review and test; no game files. |
|
Thanks @byPreaZy for testing on AMD RX 9060 XT and checking those two edge cases! Confirmed both against Windows 11 host
AI-assisted; synthetic probe only. |
|
Tested
AI-assisted (Claude Code). |
Claimed in the coordination issue as: #7804 (comment)
Depends on: none
What and why
runtime/shims/d3d12_vulkan_device.cpp:D3D12_FEATURE_DATA_D3D12_OPTIONS13::AlphaBlendFactorSupported = TRUE(the layer already mapsD3D12_BLEND_ALPHA_FACTOR/D3D12_BLEND_INV_ALPHA_FACTORto Vulkan 1.0 coreVK_BLEND_FACTOR_CONSTANT_ALPHA/VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA).blend_factor/blend_opfallbacks withmap_blend_factor,map_blend_op, andconvert_blend_attachment: validates activeRenderTargetentries (0or0..7whenIndependentBlendEnable) inCreateGraphicsPipelineStatewhenBlendEnableorLogicOpEnableis set, returningE_INVALIDARGon out-of-range/gapD3D12_BLENDvalues (0,12,13,>21),*_COLORfactors onSrcBlendAlpha/DestBlendAlpha, invalidD3D12_BLEND_OP,BlendEnable && LogicOpEnable,IndependentBlendEnable && LogicOpEnable, and out-of-rangeLogicOp, while keeping valid Vulkan defaults whenBlendEnable == FALSE.runtime/test/d3d12_vulkan_device_test.cpp: updatescompare_feature_optionsto assertOPTIONS13::AlphaBlendFactorSupported == TRUEalongside the existing host parity comparison.runtime/test/d3d12_state_sweep_test.cpp: addsD3D12_BLEND_ALPHA_FACTOR/D3D12_BLEND_INV_ALPHA_FACTORcases, disabled-blend invalid-factor acceptance, and 13 invalid-blend host-parity cases comparing exact refusalHRESULT(mine.pso != reference.pso).runtime/test/d3d12_draw_test.cpp: adds Vulkan-side checks forOPTIONS13::AlphaBlendFactorSupported, invalid blend refusal cases, andD3D12_BLEND_ALPHA_FACTOR/D3D12_BLEND_INV_ALPHA_FACTORdraw parity (OMSetBlendFactor({0.1f, 0.2f, 0.3f, 0.4f})andnullptr->1.0f) onB8G8R8A8_UNORMandB8G8R8X8_UNORM.Tested
Windows 11, MSVC 2022 (
19.44.35228.0), Windows SDK10.0.26100.0, Vulkan SDK1.4.363.0, NVIDIA GeForce RTX 5090 D / driver621.14. Synthetic inputs only; no game data.python -I scripts/check_no_game_data.pyon all 4 changed files exited0;git diff --checkclean;0CRLF bytes across all 4 changed files.cmake --build runtime/build --config RelWithDebInfo -j 8(-DLEONIDA_REQUIRE_VULKAN=ON) ->665/665targets built, exit0.LEONIDA_VK_VALIDATION=1runs:d3d12_state_sweep_test.exe(LEONIDA_VK_VALIDATION=1):601 cases compared with NVIDIA GeForce RTX 5090 D, 0 differ; 0 skipped, exit0.d3d12_draw_test.exe(LEONIDA_VK_VALIDATION=1):ALPHA_FACTOR: OPTIONS13, validation and B8G8R8A8/B8G8R8X8 colour/alpha factor blends matched, exit0.d3d12_state_sweep,d3d12_draw,d3d12_bindless_churn,d3d12_bindless_churn_validated:4/4passed.d3d12_vulkan_device_test.exe:CheckFeatureSupport options (NVIDIA GeForce RTX 5090 D): 46 feature queries compared (0 host-unsupported skipped), 0 mismatchespassed (still exits1later on the pre-existingupstream/mainline6574: tiles == 1check).ctest -j 4:268/272passed (11skipped,1disabled;3pre-existingupstream/mainfailuresd3d12_vulkan_device,d3d12_indirect_dispatch_count,d3d12_depth_resolve, plus one parallel temp-dir race#238which passed standalone).runtime/shims/d3d12_vulkan_device.cppfix temporarily reverted):d3d12_vulkan_device_test.exefailedOPTIONS13 mismatch(1 mismatches).d3d12_state_sweep_test.exefailed all 13 invalid-blend parity cases (601 cases compared with NVIDIA GeForce RTX 5090 D, 13 differ; 0 skipped, exit1).d3d12_draw_test.exefailedoptions13.AlphaBlendFactorSupported == TRUE(line 862), exit1.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)