From 76da16f0baebddb3edd70e012c5db6b32ead6e64 Mon Sep 17 00:00:00 2001 From: KOLESNiii <102358205+KOLESNiii@users.noreply.github.com> Date: Sat, 28 Nov 2026 05:15:06 +0000 Subject: [PATCH] D3D12.X: console device #124 CreateCommandQueue1 creates a console queue The console device has CreateCommandQueue1 at #124 (PC #75), in the run of the PC's newer device methods that ends with #127 CreateCommittedResource3. It fell into the console-extension stub, which answers S_OK with the out pointer untouched: a title got a NULL queue. It now takes the console queue path of #8 / #48 (console queue types, present tracking, queue adoption); the creator ID only groups queues for the PC's scheduler and is dropped. The identity is from a console API audit; no log yet shows a title calling it. Co-Authored-By: Claude Opus 5.5 Assisted-by: Codex (exact model unavailable) --- crates/xcl/src/hle/d3d12x/device_x.rs | 7 +++++++ crates/xcl/src/hle/d3d12x/real.rs | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/crates/xcl/src/hle/d3d12x/device_x.rs b/crates/xcl/src/hle/d3d12x/device_x.rs index 4221fe40bf..9860929017 100644 --- a/crates/xcl/src/hle/d3d12x/device_x.rs +++ b/crates/xcl/src/hle/d3d12x/device_x.rs @@ -87,6 +87,13 @@ pub(super) unsafe extern "system" fn create_command_queue_x(this: *mut c_void, d hr } +/// device #124 CreateCommandQueue1(desc, creator ID, riid, queue) (PC #75): #8 with a creator ID, +/// which only groups queues for the PC's scheduler +pub(super) unsafe extern "system" fn create_command_queue1_x(this: *mut c_void, desc: *const [u32; 4], _creator: *const GUID, riid: *const GUID, ppv: *mut *mut c_void) -> HRESULT { + real::note_newer_device_method(124); + create_command_queue_x(this, desc, riid, ppv) +} + /// device #9 CreateCommandAllocator(type, riid, allocator) pub(super) unsafe extern "system" fn create_command_allocator_x(this: *mut c_void, ty: u32, riid: *const GUID, ppv: *mut *mut c_void) -> HRESULT { real::dev_create_command_allocator(this, pc_list_type(ty) as usize, riid, ppv) diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs index fc78555403..c92a5e75ab 100644 --- a/crates/xcl/src/hle/d3d12x/real.rs +++ b/crates/xcl/src/hle/d3d12x/real.rs @@ -71,6 +71,23 @@ pub enum Kind { StateObject, } +#[cfg(test)] +mod device_queue1_tests { + use super::*; + + /// Console device #124 is CreateCommandQueue1 (PC #75, at the distance of #127 from its PC + /// slot): it gets the console queue path, as #8 and #48. + #[test] + fn console_device_124_creates_a_console_queue() { + let dev = layout::chain("ID3D12Device")[0]; + assert_eq!(layout::slot(dev, "CreateCommandQueue1"), Some(75)); + assert_eq!(layout::slot(dev, "CreateCommittedResource3").map(|p| p + 51), Some(127)); + let slots = console_slots(Kind::Device); + assert!(slots.contains(&(124, super::super::device_x::create_command_queue1_x as usize))); + assert_eq!(slots.iter().filter(|e| e.0 == 124).count(), 1); + } +} + #[cfg(test)] mod slot_cache_tests { use super::*; @@ -1611,6 +1628,7 @@ fn console_slots(kind: Kind) -> Vec<(usize, usize)> { (108, x::get_resource_allocation_info2_x as usize), (127, dev_create_committed_resource_layout_x as usize), (133, x::create_placed_resource_layout_x as usize), + (124, x::create_command_queue1_x as usize), ] } Kind::DescriptorHeap => vec![(8, heap_get_desc_x as usize), (9, heap_cpu_start_x as usize), (10, heap_gpu_start_x as usize)],