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

Merged
gefydev merged 1 commit from upstream-pr/121 into main 2026-11-23 14:13:38 +00:00
gefydev commented 2026-11-23 13:23:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-23T13:23:02Z.


#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.

<!-- greyfinch-sync:ivall/xcl:issue:6560291398 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/121). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-23T13:23:02Z. --- #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.
upstream-sync closed this pull request 2026-11-24 06:57:14 +00:00
ivall commented 2026-11-24 07:00:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T14:14:09Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7103687475 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/121#issuecomment-7103687475). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T14:14:09Z. --- 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!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!120
No description provided.