Committed console resources XCL does not place get the PC's description

A committed console resource that is not placed in unified memory went
to the PC with the console's desc, only its layout field fixed. The
console's flag bits and alignment made the PC refuse it. With the 512 MB
coherent window (and the room committed textures leave free) Fortnite's
menu reached that path for its 3264x1836 scene targets: E_INVALIDARG,
and the game crashed reading the missing resource. The fallback now uses
device_x::pc_resource_desc, like placed console resources.
This commit is contained in:
ivall
2026-11-22 21:44:55 +01:00
parent 5dd2d56b4e
commit 4de9016b56
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -1193,6 +1193,10 @@ of the title (it writes to address 0 after a failed D3D12 call: `call 0x14068c76
and had the 512 MB window full in its first second (no room for readback heaps); it now stops at 384 MB, the and had the 512 MB window full in its first second (no room for readback heaps); it now stops at 384 MB, the
picture unchanged. Putting them in the sparse windows instead made XDefiant render black (cache warm, no errors picture unchanged. Putting them in the sparse windows instead made XDefiant render black (cache warm, no errors
in the log) – not understood yet; the GPU-owned ones go to `vram` arenas either way. in the log) – not understood yet; the GPU-owned ones go to `vram` arenas either way.
- A committed console resource XCL does not place is created with the PC's description
(`device_x::pc_resource_desc`: the driver's alignment, its layout, console flag bits off). With the smaller
coherent window Fortnite's menu reached that path for its 3264x1836 scene targets; the console desc gave
E_INVALIDARG and the game crashed reading the missing resource.
- XDefiant's menu runs at ~53 fps (~50 before PR #40). Its CPU cost of the sparse windows is the per-submit - XDefiant's menu runs at ~53 fps (~50 before PR #40). Its CPU cost of the sparse windows is the per-submit
write-watch scan over the mapped tiles (~2 GB): ~0.8 ms per submit at ~800 submits a second, then ~0.3 ms of write-watch scan over the mapped tiles (~2 GB): ~0.8 ms per submit at ~800 submits a second, then ~0.3 ms of
uploads (64-byte chunk runs of ~0.5 KB on average). Merging the runs or skipping scans would be faster, but a uploads (64-byte chunk runs of ~0.5 KB on average). Merging the runs or skipping scans would be faster, but a
+5
View File
@@ -1627,6 +1627,11 @@ unsafe extern "system" fn dev_create_committed_resource_x(this: *mut c_void, pro
return hr; return hr;
} }
} }
// not placed in unified memory (e.g. its coherent window kept for readback heaps): a PC
// resource of the PC's description – the console's flag bits (0x1000000, 0x300000 …) and
// alignments made the PC refuse Fortnite's 3264x1836 scene targets (E_INVALIDARG, a crash)
let pc_full = (console_desc != 0 && crate::gpu::shader::readable(console_desc, 0x38)).then(|| super::device_x::pc_resource_desc(&(console_desc as *const [u8; 0x38]).read_unaligned()));
let desc = pc_full.as_ref().map_or(desc, |d| d.as_ptr() as usize);
// console-only state bits (e.g. 0x100000 on a display target) are not the PC's // console-only state bits (e.g. 0x100000 on a display target) are not the PC's
let hr = dev_create_committed_resource(this, props, flags, desc, state & PC_RESOURCE_STATES as usize, clear, riid, ppv); let hr = dev_create_committed_resource(this, props, flags, desc, state & PC_RESOURCE_STATES as usize, clear, riid, ppv);
if hr < 0 { if hr < 0 {