D3D12.X: queue #18 before the layout is known writes 8 bytes #121

Manually merged
github merged 1 commit from gh-pr/121/head into gh-pr/121/base 2026-11-26 04:11:09 +00:00
Owner

@⁠gefydev on GitHub · 2026-11-23 13:23 UTC · original
gefydev:d3d12x-queue-slot18 → main · +66 −0 · 1 files · 1 commits · merged 2026-11-23 14:13 UTC

#104 item 4.

Until the title's calls show which queue layout it has, queue_dispatch sent #18 to the older layout's GetDesc, which writes a 16-byte D3D12_COMMAND_QUEUE_DESC. On the newer layout #18 is GetTimestampFrequency(UINT64*), so a call before the first Signal wrote 8 bytes past the out-param.

Changes:

  • A Signal / Wait with a fence at #14 / #15 now marks the older layout (QUEUE_OLDER). This is the same test the dispatch already uses to route those slots.
  • While neither layout is known, #18 calls GetDesc into a local buffer and copies only the first 8 bytes (Type, Priority) to the out-param. It logs one warning.
  • Once a layout is known, #18 works as before: the full GetDesc on the older layout, GetTimestampFrequency on the newer one.

Cost: an older-layout title that calls GetDesc before it signals anything gets Flags / NodeMask unwritten. Before this change, a newer-layout title in the same position had its stack overwritten.

Test queue_slot_18_before_the_layout_is_known_writes_8_bytes uses a fake adopted queue (its own PC table). It checks the 8-byte write before the layout is known, then the full description after a fenced Signal at #14. Without the change it fails (all 16 bytes written). The other lib tests that run on a GTX 1650 under Wine pass too. Not run with a retail title.

**@⁠gefydev** on GitHub · 2026-11-23 13:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/121) `gefydev:d3d12x-queue-slot18` → `main` · +66 −0 · 1 files · 1 commits · merged 2026-11-23 14:13 UTC #104 item 4. Until the title's calls show which queue layout it has, `queue_dispatch` sent #18 to the older layout's GetDesc, which writes a 16-byte `D3D12_COMMAND_QUEUE_DESC`. On the newer layout #18 is `GetTimestampFrequency(UINT64*)`, so a call before the first Signal wrote 8 bytes past the out-param. Changes: - A Signal / Wait with a fence at #14 / #15 now marks the older layout (`QUEUE_OLDER`). This is the same test the dispatch already uses to route those slots. - While neither layout is known, #18 calls GetDesc into a local buffer and copies only the first 8 bytes (Type, Priority) to the out-param. It logs one warning. - Once a layout is known, #18 works as before: the full GetDesc on the older layout, GetTimestampFrequency on the newer one. Cost: an older-layout title that calls GetDesc before it signals anything gets Flags / NodeMask unwritten. Before this change, a newer-layout title in the same position had its stack overwritten. Test `queue_slot_18_before_the_layout_is_known_writes_8_bytes` uses a fake adopted queue (its own PC table). It checks the 8-byte write before the layout is known, then the full description after a fenced Signal at #14. Without the change it fails (all 16 bytes written). The other lib tests that run on a GTX 1650 under Wine pass too. Not run with a retail title.
Until a title's queue calls show which console layout its runtime has,
queue #18 went to the older layout's GetDesc, which writes a 16-byte
D3D12_COMMAND_QUEUE_DESC. On the newer layout #18 is
GetTimestampFrequency(UINT64*), so a call before the first Signal wrote 8
bytes past the title's out-param.

A Signal / Wait with a fence at #14 / #15 now marks the older layout. Until
one of the layouts is known, #18 writes only the first 8 bytes of the
description (type and priority) and logs a warning once. After that it is
the full GetDesc (older) or GetTimestampFrequency (newer), as before.

Test queue_slot_18_before_the_layout_is_known_writes_8_bytes (fake adopted
queue).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:11:08 +00:00
github manually merged commit a01d61c2a1 into gh-pr/121/base 2026-11-26 04:11:09 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-23 14:14 UTC · original

Merged. Checked on Windows 11 with an RX 9070 (RDNA4), merged together with the rest of #110–#129: cargo test --workspace green with the retail samples (shader pack, console DLLs, texture archive), lib tests also with XCL_SPLIT_WAVE64=1; the retail pack still translates 26 698 / 26 698; the FSR4 GPU probe passes; Unicorn Overlord and XDefiant run. Thanks!

**@⁠ivall** on GitHub · 2026-11-23 14:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/121#issuecomment-7103687475) Merged. Checked on Windows 11 with an RX 9070 (RDNA4), merged together with the rest of #110–#129: `cargo test --workspace` green with the retail samples (shader pack, console DLLs, texture archive), lib tests also with `XCL_SPLIT_WAVE64=1`; the retail pack still translates 26 698 / 26 698; the FSR4 GPU probe passes; Unicorn Overlord and XDefiant run. Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.