You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is in it
Sanitize console resource, clear-value, initial-state, heap-flag, and heap-property arguments on the PC CreateCommittedResource paths in crates/xcl/src/hle/d3d12x/real.rs:
create_display_target now converts the console resource description with pc_resource_desc_for_device(this, &x) (matching dev_create_committed_resource_x and create_placed_resource_x), aligns any optimized D3D12_CLEAR_VALUE format via pc_clear_for_desc, strips console-only initial state bits and dropped-UAV states via pc_initial_state_for_desc, and maps console-only heap types (!(1..=5)) to D3D12_HEAP_TYPE_DEFAULT via pc_heap_properties.
dev_create_committed_resource_x now sanitizes console D3D12_HEAP_FLAGS via pc_committed_heap_flags (dropping ALLOW_DISPLAY, tier-1 DENY_* flags, and console-only bits that PC CreateCommittedResource rejects with E_INVALIDARG) and console-only heap types via pc_heap_properties on its PC committed-resource fallback path.
Added unit and child-process WARP tests in hle::d3d12x::real::committed_display_target_sanitize_tests covering pc_committed_heap_flags, pc_heap_properties, display targets with promoted console formats (116 -> R16G16B16A16_FLOAT, B8G8R8X8_UNORM + UAV -> B8G8R8A8_UNORM) and optimized clear values, stripped-UAV sRGB display targets in UNORDERED_ACCESS, console state bit 0x10_0000, and dev_create_committed_resource_x with console heap flags and heap type.
Tested
Verified the new WARP test failed before the fix (display target format 116 with clear value failed: 0x80070057) and passed after (2 passed, 0 failed, including verifying case 5 exercises the PC CreateCommittedResource fallback rather than UMA placement).
Retail titles creating HDR/console-format display targets or committed resources with console heap flags on AMD/Intel drivers (verified on WARP and RTX 5070 Ti only).
test_title_runs_and_game_folder_is_untouched and uma_driver::tests:: were skipped in the workspace run; wave64 GPU tests were skipped on this wave32 RTX 5070 Ti.
AI use
Assisted with auditing the unsanitized create_display_target and dev_create_committed_resource_x PC fallback paths, writing the helpers and synthetic unit/WARP tests, and running the workspace and smoke verification; all diffs and results were reviewed directly.
merge-check
base: d0832e6
head: 3ba24ec
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2892 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (real.rs, +237/-3, ~45 lines outside tests). It changes the default path: every display target and every committed resource that falls back to the PC path now has its heap flags masked, and heap types outside 1-5 become DEFAULT. Inputs the PC already accepts look unaffected (SHARED, CREATE_NOT_ZEROED and ALLOW_SHADER_ATOMICS are kept). Findings: (1) the comment at ~3808 says the PC rejects ALLOW_DISPLAY and the DENY_* flags, but no test sets them on their own. Case 5 (~15224) combines them with the console-only 0x2 bit and heap type 6, either of which fails alone, yet they're now stripped unconditionally, unlike dev_create_heap, which strips only after the PC refuses. (2) Case 4 (~15209) tests state 0x100000 in create_display_target, which its only caller can't pass (layout_state never produces it). (3) Case 5's console_buffer(...).is_none() assert (~15238) checks nothing for a texture (only buffers are tracked). (4) Display-target sanitizing and committed heap flags/type are two changes. (5) #3418 switches dev_create_committed_resource_x to a new pc_clear_for_resource_desc, while display targets here keep pc_clear_for_desc; no textual conflict, but they can drift. (6) AI use names no tool or model; no what-and-why paragraph or issue link; the suite run skipped the e2e test and uma_driver::tests::; both of the PR's smoke runs end at 0 presents per 2 s, so they don't show the title reaching these paths. Fine: main already promoted 116 -> 10 and 88 -> 87 for display targets, so presenting and RTV use are unchanged; the helpers match the committed and placed paths; the child test uses skip_test and forwards SKIPPED.
performance: 60 s smoke of a retail title, main d0832e6 vs this merge (2c6b1a00): 1516 -> 1685 frames shown (111 %; last presents per 2 s: 60 60 60), peak commit 18133 -> 16862 MB, 0 device removals, 0 crashes. git diff --check flags a new blank line at the end of real.rs.
verdict: safe to merge (splitting display targets from committed heap flags, and a test that sets ALLOW_DISPLAY / DENY_* alone, would make it stronger)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area:d3d12D3D12.X runtime, command lists, resources, sparse memorygpu:bothCode affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)needs:amd-testNeeds a test report or merge-check on an AMD GPUneeds-2nd-checkHas 1 safe merge-check; needs second independent check (#3041)
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is in it
Sanitize console resource, clear-value, initial-state, heap-flag, and heap-property arguments on the PC
CreateCommittedResourcepaths incrates/xcl/src/hle/d3d12x/real.rs:create_display_targetnow converts the console resource description withpc_resource_desc_for_device(this, &x)(matchingdev_create_committed_resource_xandcreate_placed_resource_x), aligns any optimizedD3D12_CLEAR_VALUEformat viapc_clear_for_desc, strips console-only initial state bits and dropped-UAV states viapc_initial_state_for_desc, and maps console-only heap types (!(1..=5)) toD3D12_HEAP_TYPE_DEFAULTviapc_heap_properties.dev_create_committed_resource_xnow sanitizes consoleD3D12_HEAP_FLAGSviapc_committed_heap_flags(droppingALLOW_DISPLAY, tier-1DENY_*flags, and console-only bits that PCCreateCommittedResourcerejects withE_INVALIDARG) and console-only heap types viapc_heap_propertieson its PC committed-resource fallback path.hle::d3d12x::real::committed_display_target_sanitize_testscoveringpc_committed_heap_flags,pc_heap_properties, display targets with promoted console formats (116->R16G16B16A16_FLOAT,B8G8R8X8_UNORM + UAV->B8G8R8A8_UNORM) and optimized clear values, stripped-UAV sRGB display targets inUNORDERED_ACCESS, console state bit0x10_0000, anddev_create_committed_resource_xwith console heap flags and heap type.Tested
display target format 116 with clear value failed: 0x80070057) and passed after (2 passed, 0 failed, including verifying case 5 exercises the PCCreateCommittedResourcefallback rather than UMA placement).cargo test -p xcl --lib -j 4 -- hle::d3d12x::real:: --skip failed_binding_keeps_indirect_commands_until_allocator_reset --test-threads=4:167 passed, 0 failed.cargo test --workspace -j 2 -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::with DXC 1.9 on NVIDIA GeForce RTX 5070 Ti, wave32):2611 passed, 0 failed, 49 ignoredacross 41 test suites (26runtimeSKIPPEDmessages:21wave64-only checks on wave32 hardware,3per-lane-form#1426refusals forV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32, and2XCL_HEAP_WINDOWS=1opt-in checks).Regression run
Not tested
test_title_runs_and_game_folder_is_untouchedanduma_driver::tests::were skipped in the workspace run; wave64 GPU tests were skipped on this wave32 RTX 5070 Ti.AI use
Assisted with auditing the unsanitized
create_display_targetanddev_create_committed_resource_xPC fallback paths, writing the helpers and synthetic unit/WARP tests, and running the workspace and smoke verification; all diffs and results were reviewed directly.