Repository navigation
D3D12.X: strip console-only fence flags on CreateFence - #3386
Conversation
|
Reviewed and tested at Looks clean and minimal — Tested locally
AI use
|
|
Test report for #3386 at Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
Source review of head On a runtime and device supporting fence barriers, Please preserve the two defined PC bits while stripping confirmed console-only bits and upper-32-bit garbage. Let native D3D12 validate feature support and flag combinations rather than silently changing valid requested flags. Replace the Minimal mask and unit-test candidatediff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
@@
const PC_FENCE_FLAGS_MASK: u32 = (D3D12_FENCE_FLAG_SHARED.0
| D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER.0
- | D3D12_FENCE_FLAG_NON_MONITORED.0) as u32;
+ | D3D12_FENCE_FLAG_NON_MONITORED.0
+ | 0x8 // D3D12_FENCE_FLAG_ALLOW_COMMAND_LIST_BARRIERS
+ | 0x10) as u32; // D3D12_FENCE_FLAG_ALLOW_QUEUE_AND_CPU_SYNC
@@
- assert_eq!(pc_fence_flags(0x8 | non_mon), non_mon);
+ assert_eq!(pc_fence_flags(0x8 | non_mon), 0x8 | non_mon);
+ assert_eq!(pc_fence_flags(0x10018), 0x18);The candidate above illustrates the mask change; use the SDK's named constants if available in the binding. This review did not run builds, tests, or a title. AI use: OpenAI Codex (GPT-6.2 Sol) traced the PR and current D3D12 definitions; OpenAI Codex (GPT-6.2 Astra) independently checked the fence-barrier contract. |
|
merge-check |
|
Merged at the checked head after a combined trial of #3400, #3386, #3393 and #3535 on AI use: Claude Code (Claude Opus 5.5). |
What is in it
D3D12_FENCE_FLAGSindev_create_fence(crates/xcl/src/hle/d3d12x/real.rs) viapc_fence_flags(flags)before calling PCCreateFence:0x7(D3D12_FENCE_FLAG_SHARED | D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER | D3D12_FENCE_FLAG_NON_MONITORED) and any upper-32-bit caller garbage, preventing PCCreateFencefrom rejecting console fence flags withE_INVALIDARG(0x80070057).hle::d3d12x::real::fence_flags_tests(pc_fence_flags_strips_console_and_upper_bitsanddev_create_fence_sanitizes_console_flags).Tested
dev_create_fence_sanitizes_console_flagsfails before the fix on WARP with0x80070057(E_INVALIDARG) when passed console flag bit0x10000.cargo test -p xcl --lib -j 4 -- hle::d3d12x::real::fence_flags_tests:: --nocapture): 2 passed, 0 failed, 0 ignored.cargo test --workspace -j 2 -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::withXCL_DXC_DIRset to DXC 1.9 on RTX 5070 Ti): 41 test binaries, 2611 passed, 0 failed, 49 ignored, 9 filtered out.SKIPPEDbreakdown (26 total): 21no wave64(RTX 5070 Ti is wave32), 3refused(V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32#1426semantics), 2no heap windows(XCL_HEAP_WINDOWS=1opt-in).Regression run
Not tested
D3D12_FENCE_FLAG_NON_MONITOREDwas only checked in the pure bitmask unit test because the WARP software adapter does not support non-monitored fences.CreateFencewere not run directly; those paths are covered by the synthetic unit and WARP tests.test_title_runs_and_game_folder_is_untouched,uma_driver::tests::, wave64 GPU tests, andXCL_HEAP_WINDOWS=1opt-in unit tests were not run in the workspace suite.AI use