D3D12.X: map full D3D12_BARRIER_LAYOUT set and mask console modifiers in layout_state #3238
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3238"
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 ivall/xcl. Originally posted by Kalmarv on 2026-11-28T23:42:09Z.
device_x::layout_state(crates/xcl/src/hle/d3d12x/device_x.rs) previously matched only baseD3D12_BARRIER_LAYOUTvalues1..=10without stripping console layout-modifier bits in[30:22](0x7FC0_0000). OnCreatePlacedResourceX(#133) andCreateCommittedResourceLayoutX(#127),SHADING_RATE_SOURCE(11), video layouts (12..=17), queue-specific layouts (18..=30), console cross-queue generic read (32), and any layout carrying console modifier bits silently fell back toCOMMON(0).What is in it
crates/xcl/src/hle/d3d12x/device_x.rs: checkD3D12_BARRIER_LAYOUT_UNDEFINED(u32::MAX) ->COMMON(0), mask off console modifier bits (layout & !0x7FC0_0000), and map11(SHADING_RATE_SOURCE->0x100_0000),12..=17(video decode/process/encode read/write), queue-specific direct/compute layouts (19..=23,25..=29), and32(cross-queue generic read ->0xAC3) to their correspondingD3D12_RESOURCE_STATESvalues.crates/xcl/src/hle/d3d12x/device_x.rs(mod tests): addlayout_state_maps_queue_specific_shading_rate_video_and_console_modifiers.Tested
cargo test --workspace -- --test-threads=4: 2596 passed, 0 failed, 49 ignored.SKIPPEDGPU tests on RTX 5070 Ti (26 total): 21no wave64(wave32-only adapter), 3#1426per-lane f16 refusals (V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32), 2no heap windows(defaultXCL_HEAP_WINDOWSoff). Zerono GPUorno DXCskips.left: 0, right: 16777216) -> passing-after verification ondevice_x::tests::layout_state_maps_queue_specific_shading_rate_video_and_console_modifiers(20/20device_x::tests).XCL_DIRECT_DXIL=all(1676frames vs1695on main,0device removals,0crashes), plus combined steady-world validation run (LIGHT_NO_FLUSH: exit0x0,1.94steady FPS,0removals).Regression run
Not tested
no wave64tests skipped on RTX 5070 Ti).12..=17on a real title.AI use
layout_statemapping and unit test, ran the workspace test suite and title regression run on hardware, and drafted the PR description.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:01:58Z.
Review (head
59f6dc22, diff read, not a merge-check; it conflicts with main, so not built or run):device_x.rs~1305). On PC, 31 isDIRECT_QUEUE_GENERIC_READ_COMPUTE_QUEUE_ACCESSIBLE, and main'sbarrier_groups::state_ofmaps it to SHADER_RESOURCE | COPY_SOURCE. So a resource created in layout 31 starts in COMMON while the next barrier out of 31 assumes 0x8C0, and the PC gets a wrong StateBefore.barrier_groups::state_of(2b75212d, after this PR's base); using it inlayout_statewould keep creation and barriers consistent. The two already differ on generic read (0xAC3 vs 0x8C0) and depth read, andstate_ofdoesn't apply the new0x7FC0_0000"modifier" mask. Where do that mask and layout 32 come from? Nothing in the repo records a title passing them. #839 (open) also maps 11 and 19-29 inlayout_state.device_x'smod tests(7e242379added one there);layout_stateitself is unchanged on main, so not superseded. The CI failures are inpipeline_library/warm_library, outside this diff.Fine: the video and shading-rate state constants are right, UNDEFINED maps to COMMON, and the test fails without the change.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T19:38:22Z.
Closing: conflicts in
device_x.rs, overlaps earlier #839 (#1607 D190), and duplicatesbarrier_groups::state_ofwith unsourced layout/modifier mappings.Pull request closed