diff --git a/runtime/shims/d3d12_xs_device.cpp b/runtime/shims/d3d12_xs_device.cpp index 202b97f45..b55498200 100644 --- a/runtime/shims/d3d12_xs_device.cpp +++ b/runtime/shims/d3d12_xs_device.cpp @@ -63,6 +63,9 @@ struct DeviceProxy { // The console runtime layout this title was built against (docs/d3d12_xs_console_abi.md §4): the queue proxy // writes it on detection and every object shares it — the queue/list slot tails shift +2 under the newer one. std::atomic console_layout{0}; // 0 unknown, 1 older, 2 newer + // Set by create_device_proxy: false hands real (PC-shaped) lists back from CreateCommandList for callers + // compiled against the PC headers. + bool console_lists = true; }; // Freed in proxy_release; defined where the states are complete. @@ -452,8 +455,9 @@ struct ChildProxy { unsigned slot_count; // public slots the real object implements; the rest of the table is refused std::atomic refs; // Queues only: the console runtime layout this title was built against (docs/d3d12_xs_console_abi.md §4), - // detected by a fence reaching slot 16/17. Unused on fences and allocators. Concurrent Signal/Wait calls - // on the same queue can race the detection write, so it is atomic like the shared device flag. + // detected by a fence reaching slot 16/17 or SignalX slot 25. Unused on fences and allocators. A queue is + // used from many threads, so the cache of the device's shared detection is atomic like the shared flag + // itself. static constexpr unsigned char kQueueLayoutUnknown = 0; static constexpr unsigned char kQueueLayoutOlder = 1; // PC order; PresentX 30, SignalX 23 static constexpr unsigned char kQueueLayoutNewer = 2; // +2 shift; PresentX 32, SignalX 25 @@ -866,15 +870,15 @@ std::uint64_t WINAPI child_slot(ChildProxy* self, std::uint64_t a1, std::uint64_ // signals only through SignalX never reaches Signal/Wait at 16/17, and an unanswered SignalX // returns S_OK having signalled nothing, leaving a waiter on that fence value hanging. const bool newer = [&] { - if (self->queue_layout == ChildProxy::kQueueLayoutNewer) return true; + const unsigned char own = self->queue_layout.load(std::memory_order_relaxed); + if (own == ChildProxy::kQueueLayoutNewer) return true; const unsigned char shared = self->device->console_layout.load(std::memory_order_relaxed); - return self->queue_layout == ChildProxy::kQueueLayoutUnknown && - shared == ChildProxy::kQueueLayoutNewer; + return own == ChildProxy::kQueueLayoutUnknown && shared == ChildProxy::kQueueLayoutNewer; }(); if (Slot == 16 || Slot == 17) { if (IUnknown* fence = proxy_real_object(reinterpret_cast(a1))) { - self->queue_layout = ChildProxy::kQueueLayoutNewer; + self->queue_layout.store(ChildProxy::kQueueLayoutNewer, std::memory_order_relaxed); self->device->console_layout.store(ChildProxy::kQueueLayoutNewer, std::memory_order_relaxed); using Fn = HRESULT(WINAPI*)(IUnknown*, IUnknown*, UINT64); @@ -883,8 +887,9 @@ std::uint64_t WINAPI child_slot(ChildProxy* self, std::uint64_t a1, std::uint64_ } if (newer) return hr_to_u64(S_OK); // proven newer: a non-fence Signal/Wait arg is malformed, // not evidence of the older layout — do not downgrade the shared detection on it - if (self->queue_layout == ChildProxy::kQueueLayoutUnknown) { - self->queue_layout = ChildProxy::kQueueLayoutOlder; + if (self->queue_layout.load(std::memory_order_relaxed) == + ChildProxy::kQueueLayoutUnknown) { + self->queue_layout.store(ChildProxy::kQueueLayoutOlder, std::memory_order_relaxed); self->device->console_layout.store(ChildProxy::kQueueLayoutOlder, std::memory_order_relaxed); } @@ -919,7 +924,8 @@ std::uint64_t WINAPI child_slot(ChildProxy* self, std::uint64_t a1, std::uint64_ self->real, reinterpret_cast(a1))); } if (Slot == (newer ? 25u : 23u) || - (Slot == 25u && self->queue_layout == ChildProxy::kQueueLayoutUnknown && + (Slot == 25u && self->queue_layout.load(std::memory_order_relaxed) == + ChildProxy::kQueueLayoutUnknown && self->device->console_layout.load(std::memory_order_relaxed) == ChildProxy::kQueueLayoutUnknown)) { // SignalX: console Signal (older 23, newer 25); the extra X word is dropped. The slot-25 @@ -928,7 +934,8 @@ std::uint64_t WINAPI child_slot(ChildProxy* self, std::uint64_t a1, std::uint64_ // methods sit at 14/15/23 there. if (IUnknown* fence = proxy_real_object(reinterpret_cast(a1))) { if (Slot == 25u && !newer) { - self->queue_layout = ChildProxy::kQueueLayoutNewer; + self->queue_layout.store(ChildProxy::kQueueLayoutNewer, + std::memory_order_relaxed); self->device->console_layout.store(ChildProxy::kQueueLayoutNewer, std::memory_order_relaxed); } @@ -1513,6 +1520,14 @@ HRESULT proxy_create_command_list(DeviceProxy* self, std::uint64_t node_mask, st static_cast(type), reinterpret_cast(unwrap_object(allocator)), reinterpret_cast(pso), *riid, nullptr); + if (!self->console_lists) { + // PC caller (create_device_proxy's console_lists=false): the real list answers every PC slot, and the + // console-only pieces (slot 148, the shifted tail) are simply not there for this caller to reach. + return self->real->CreateCommandList(static_cast(node_mask), + static_cast(type), + reinterpret_cast(unwrap_object(allocator)), + reinterpret_cast(pso), *riid, out); + } void* created = nullptr; const HRESULT hr = self->real->CreateCommandList( static_cast(node_mask), static_cast(type), @@ -1923,7 +1938,7 @@ unsigned detect_slot_count(ID3D12Device* real) { } // namespace -HRESULT create_device_proxy(ID3D12Device* real, REFIID riid, void** out) { +HRESULT create_device_proxy(ID3D12Device* real, REFIID riid, void** out, bool console_lists) { if (!real) return E_POINTER; if (!out) return E_POINTER; *out = nullptr; @@ -1934,6 +1949,7 @@ HRESULT create_device_proxy(ID3D12Device* real, REFIID riid, void** out) { proxy->real = real; proxy->real_vtable = *reinterpret_cast(real); proxy->slot_count = detect_slot_count(real); + proxy->console_lists = console_lists; proxy->refs.store(1, std::memory_order_relaxed); const unsigned slot_count = proxy->slot_count; diff --git a/runtime/shims/d3d12_xs_device.h b/runtime/shims/d3d12_xs_device.h index 70a5d0434..a23ac0616 100644 --- a/runtime/shims/d3d12_xs_device.h +++ b/runtime/shims/d3d12_xs_device.h @@ -53,7 +53,10 @@ namespace rt::d3d12_xs { // Wraps `real` and returns the requested device interface through `out`. Takes ownership of one reference to // `real` on success; on failure the caller keeps its reference. Returns E_NOINTERFACE if `riid` is not a D3D12 // device interface the PC device implements. -HRESULT create_device_proxy(ID3D12Device* real, REFIID riid, void** out); +// `console_lists` shapes the command lists CreateCommandList returns: true (the title path) gives the +// console-shaped object the Xbox ABI calls; false hands the real list back for callers compiled against +// the PC headers (the GPU test harnesses), whose vtable indices past slot 26 do not exist in console order. +HRESULT create_device_proxy(ID3D12Device* real, REFIID riid, void** out, bool console_lists = true); // True when `device` points at a proxy created by create_device_proxy. Used by the tests. bool is_device_proxy(const void* device); diff --git a/runtime/test/d3d12_buffer_uav_test.cpp b/runtime/test/d3d12_buffer_uav_test.cpp index cf936012a..652b5aa3f 100644 --- a/runtime/test/d3d12_buffer_uav_test.cpp +++ b/runtime/test/d3d12_buffer_uav_test.cpp @@ -161,7 +161,7 @@ int run_shaders(vktest::Device& d, const std::filesystem::path& root_dir, unsign EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); EXPECT(rt::d3d12::bindless_set(device.p) != VK_NULL_HANDLE); diff --git a/runtime/test/d3d12_compute_test.cpp b/runtime/test/d3d12_compute_test.cpp index cf7f7c533..2b0b14cda 100644 --- a/runtime/test/d3d12_compute_test.cpp +++ b/runtime/test/d3d12_compute_test.cpp @@ -304,7 +304,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); // Root signature: [0] two constants (s0, s1), [1] a root UAV (s2:s3), [2] a one-CBV table (s4:s5). diff --git a/runtime/test/d3d12_debug_markers_test.cpp b/runtime/test/d3d12_debug_markers_test.cpp index 8d699e21d..b5d1a0034 100644 --- a/runtime/test/d3d12_debug_markers_test.cpp +++ b/runtime/test/d3d12_debug_markers_test.cpp @@ -100,7 +100,9 @@ HRESULT make_device(const vktest::Device& d, bool debug_utils, ID3D12Device** ou ID3D12Device* inner = nullptr; HRESULT hr = rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)); if (FAILED(hr)) return hr; - hr = rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), reinterpret_cast(out)); + // PC-shaped lists: this test calls the marker methods the console ABI does not have. + hr = rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), reinterpret_cast(out), + /*console_lists=*/false); if (FAILED(hr)) { inner->Release(); return hr; @@ -135,25 +137,21 @@ int run_markers(ID3D12Device* device) { const char ansi[] = "ansi pass and more"; const wchar_t spans[] = L"spans two lists"; const std::uint64_t blob[2] = {0x1234, 0x5678}; - // The proxy hands back console-shaped lists, and the console ABI has no SetMarker or BeginEvent — its - // only marker slot is EndEvent at console 60, landing on the same PC method. The PC marker calls go to - // the real list behind each proxy; ExecuteCommandLists still takes and unwraps the proxies below. - auto* first_list = static_cast(rt::d3d12_xs::list_proxy_real_list(first.p)); - auto* second_list = - static_cast(rt::d3d12_xs::list_proxy_real_list(second.p)); - EXPECT(first_list && second_list); - first_list->SetMarker(0, frame, sizeof(frame)); - first_list->SetMarker(0, nullptr, 0); - first_list->BeginEvent(1, ansi, 9); // "ansi pass" - first_list->BeginEvent(0, nested, sizeof(nested)); - first_list->EndEvent(); - first_list->BeginEvent(0, spans, sizeof(spans)); // left open: the next list ends it - EXPECT(first_list->Close() == S_OK); - second_list->EndEvent(); // "spans two lists" - second_list->EndEvent(); // "ansi pass" - second_list->EndEvent(); // nothing open: dropped - second_list->BeginEvent(2, blob, sizeof(blob)); // left open: ended with the submission - EXPECT(second_list->Close() == S_OK); + // make_device passes console_lists=false, so first/second are the real PC-shaped lists — the console + // ABI has no SetMarker or BeginEvent, and its one marker slot (EndEvent at console 60) would land here + // on a shifted index. ExecuteCommandLists still unwraps the proxies below. + first->SetMarker(0, frame, sizeof(frame)); + first->SetMarker(0, nullptr, 0); + first->BeginEvent(1, ansi, 9); // "ansi pass" + first->BeginEvent(0, nested, sizeof(nested)); + first->EndEvent(); + first->BeginEvent(0, spans, sizeof(spans)); // left open: the next list ends it + EXPECT(first->Close() == S_OK); + second->EndEvent(); // "spans two lists" + second->EndEvent(); // "ansi pass" + second->EndEvent(); // nothing open: dropped + second->BeginEvent(2, blob, sizeof(blob)); // left open: ended with the submission + EXPECT(second->Close() == S_OK); const wchar_t queue_frame[] = L"queue frame"; const char after[] = "after"; diff --git a/runtime/test/d3d12_descriptor_test.cpp b/runtime/test/d3d12_descriptor_test.cpp index 8859cd67c..77d37fa1e 100644 --- a/runtime/test/d3d12_descriptor_test.cpp +++ b/runtime/test/d3d12_descriptor_test.cpp @@ -327,7 +327,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); // the proxy now owns `inner` D3D12_FEATURE_DATA_D3D12_OPTIONS8 options8{}; diff --git a/runtime/test/d3d12_draw_test.cpp b/runtime/test/d3d12_draw_test.cpp index df79436e8..25c198d7a 100644 --- a/runtime/test/d3d12_draw_test.cpp +++ b/runtime/test/d3d12_draw_test.cpp @@ -122,7 +122,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); // Root signature: [0] two constants (s0, s1: offset), [1] a root CBV (s2:s3: tint). diff --git a/runtime/test/d3d12_f16_halves_test.cpp b/runtime/test/d3d12_f16_halves_test.cpp index c2f194e31..bbd516e5c 100644 --- a/runtime/test/d3d12_f16_halves_test.cpp +++ b/runtime/test/d3d12_f16_halves_test.cpp @@ -222,7 +222,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); D3D12_VERSIONED_ROOT_SIGNATURE_DESC root_desc{}; diff --git a/runtime/test/d3d12_first_light_test.cpp b/runtime/test/d3d12_first_light_test.cpp index 8dcc2ca9c..c5aea7fd5 100644 --- a/runtime/test/d3d12_first_light_test.cpp +++ b/runtime/test/d3d12_first_light_test.cpp @@ -134,7 +134,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); // No root parameters: the VS applies no matrix and the PS has no bindings (vk_harness pushes zeros too). diff --git a/runtime/test/d3d12_fspx_compute_test.cpp b/runtime/test/d3d12_fspx_compute_test.cpp index b19605944..22202dd50 100644 --- a/runtime/test/d3d12_fspx_compute_test.cpp +++ b/runtime/test/d3d12_fspx_compute_test.cpp @@ -211,7 +211,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); if (rt::d3d12::device_push_constants_need_fallback(inner)) { std::printf("d3d12_fspx_compute_test: skipped, the PSOs need 144 push-constant bytes and this GPU has %u\n", diff --git a/runtime/test/d3d12_geometry_test.cpp b/runtime/test/d3d12_geometry_test.cpp index dcfb82bc1..3ee4420c3 100644 --- a/runtime/test/d3d12_geometry_test.cpp +++ b/runtime/test/d3d12_geometry_test.cpp @@ -89,7 +89,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); D3D12_ROOT_PARAMETER params[2] = {}; diff --git a/runtime/test/d3d12_m2_formats_test.cpp b/runtime/test/d3d12_m2_formats_test.cpp index 751bca8e8..36cafd54e 100644 --- a/runtime/test/d3d12_m2_formats_test.cpp +++ b/runtime/test/d3d12_m2_formats_test.cpp @@ -205,7 +205,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); EXPECT(rt::d3d12::bindless_set(device.p) != VK_NULL_HANDLE); diff --git a/runtime/test/d3d12_m2_textured_test.cpp b/runtime/test/d3d12_m2_textured_test.cpp index 8d13bf214..e742de72e 100644 --- a/runtime/test/d3d12_m2_textured_test.cpp +++ b/runtime/test/d3d12_m2_textured_test.cpp @@ -112,7 +112,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); EXPECT(rt::d3d12::bindless_set(device.p) != VK_NULL_HANDLE); diff --git a/runtime/test/d3d12_m3_frame_test.cpp b/runtime/test/d3d12_m3_frame_test.cpp index bbf8b5317..86479017d 100644 --- a/runtime/test/d3d12_m3_frame_test.cpp +++ b/runtime/test/d3d12_m3_frame_test.cpp @@ -176,7 +176,7 @@ int main(int argc, char** argv) { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); EXPECT(rt::d3d12::bindless_set(device.p) != VK_NULL_HANDLE); diff --git a/runtime/test/d3d12_m4_compute_test.cpp b/runtime/test/d3d12_m4_compute_test.cpp index e3863e997..a4530345d 100644 --- a/runtime/test/d3d12_m4_compute_test.cpp +++ b/runtime/test/d3d12_m4_compute_test.cpp @@ -133,7 +133,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); EXPECT(rt::d3d12::bindless_set(device.p) != VK_NULL_HANDLE); diff --git a/runtime/test/d3d12_msaa_draw_test.cpp b/runtime/test/d3d12_msaa_draw_test.cpp index f56057d73..9cafc994e 100644 --- a/runtime/test/d3d12_msaa_draw_test.cpp +++ b/runtime/test/d3d12_msaa_draw_test.cpp @@ -87,7 +87,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); if (rt::d3d12::device_push_constants_need_fallback(inner)) { std::printf("d3d12_msaa_draw_test: skipped, the PSOs need 144 push-constant bytes and this GPU has %u\n", diff --git a/runtime/test/d3d12_present_test.cpp b/runtime/test/d3d12_present_test.cpp index de0ff9a02..520af0e98 100644 --- a/runtime/test/d3d12_present_test.cpp +++ b/runtime/test/d3d12_present_test.cpp @@ -285,7 +285,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); auto presenter = rt::d3d12::create_window_presenter(inner, window); EXPECT(presenter); diff --git a/runtime/test/d3d12_set0_compute_test.cpp b/runtime/test/d3d12_set0_compute_test.cpp index 455f56b76..503492610 100644 --- a/runtime/test/d3d12_set0_compute_test.cpp +++ b/runtime/test/d3d12_set0_compute_test.cpp @@ -97,7 +97,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); if (rt::d3d12::device_push_constants_need_fallback(inner)) { std::printf("d3d12_set0_compute_test: skipped, the PSOs need 144 push-constant bytes and this GPU has %u\n", diff --git a/runtime/test/d3d12_subgroup_test.cpp b/runtime/test/d3d12_subgroup_test.cpp index 4eae49a5b..4894f70e2 100644 --- a/runtime/test/d3d12_subgroup_test.cpp +++ b/runtime/test/d3d12_subgroup_test.cpp @@ -182,7 +182,7 @@ Result run(vktest::Device& d, const std::filesystem::path& library, const leonid CASE_EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; CASE_EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); // Root signature: [0] four constants (s0..s3), the V# the shaders store through. @@ -375,7 +375,7 @@ DrawResult draw(vktest::Device& d, const std::filesystem::path& library, const l CASE_EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; CASE_EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); D3D12_VERSIONED_ROOT_SIGNATURE_DESC root_desc{}; diff --git a/runtime/test/d3d12_translated_draw_test.cpp b/runtime/test/d3d12_translated_draw_test.cpp index 75dbf6282..3f6fe4e2c 100644 --- a/runtime/test/d3d12_translated_draw_test.cpp +++ b/runtime/test/d3d12_translated_draw_test.cpp @@ -130,7 +130,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); // Root signature: [0] a descriptor table of one SRV (s0:s1, the table's console VA), [1] four 32-bit diff --git a/runtime/test/d3d12_vulkan_device_test.cpp b/runtime/test/d3d12_vulkan_device_test.cpp index 788b5c772..302ac989a 100644 --- a/runtime/test/d3d12_vulkan_device_test.cpp +++ b/runtime/test/d3d12_vulkan_device_test.cpp @@ -4665,7 +4665,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); // the proxy now owns `inner` EXPECT(rt::d3d12_xs::is_device_proxy(device.p)); EXPECT(rt::d3d12_xs::device_proxy_slot_count(device.p) == 80); // ID3D12Device11 @@ -4993,7 +4993,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(fallback_info, IID_PPV_ARGS(&fallback_inner)))); Ref fallback_device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(fallback_inner, __uuidof(ID3D12Device), - reinterpret_cast(&fallback_device.p)))); + reinterpret_cast(&fallback_device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(fallback_inner, fallback_device.p); D3D12_FEATURE_DATA_D3D12_OPTIONS8 options8{TRUE}; EXPECT(fallback_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS8, &options8, diff --git a/runtime/test/queue_proxy_test.cpp b/runtime/test/queue_proxy_test.cpp index f04b5287b..2259cf5d3 100644 --- a/runtime/test/queue_proxy_test.cpp +++ b/runtime/test/queue_proxy_test.cpp @@ -388,6 +388,7 @@ int check_slots(const Backend& b) { // The console queue tail answers S_OK instead of refusing: frame pacing flows through those // methods, the contract xs_proxy_mock checks too. The two methods the proxy models — SignalX at // 23 and PresentX at 30 on the older layout the 16/17 calls above pinned — are checked below. + // The fence tail below is still refused — nothing console-shaped was measured past its public chain. for (unsigned slot = 19; slot < xs::queue_proxy_table_size(); ++slot) { if (slot == 23 || slot == 30) continue; before = qhits(slot); @@ -411,13 +412,14 @@ int check_slots(const Backend& b) { EXPECT(as_hr(call_slot(fence.p, slot)) == E_NOTIMPL); EXPECT(fhits(slot) == before + 1 && xs::fence_slot_first_call_seen(slot)); } - // The objects still work after the tail calls. + // The objects still work after the console-only calls. EXPECT(SUCCEEDED(queue->Signal(fence.p, 10))); if (wait_for(label, fence.p, 10)) return 1; EXPECT(xs::command_object_proxy_ref_count(queue.p) == 1 && xs::command_object_proxy_ref_count(fence.p) == 1); } EXPECT(xs::device_proxy_ref_count(device) == device_refs); // every queue and fence gave its reference back - std::printf("%s: every public queue and fence slot forwarded and counted; console tail answered\n", label); + std::printf("%s: every public queue and fence slot forwarded and counted; queue tail S_OK, fence tail " + "refused\n", label); return 0; } diff --git a/runtime/test/xbox_present_test.cpp b/runtime/test/xbox_present_test.cpp index 4bf37f8c6..6ea54280a 100644 --- a/runtime/test/xbox_present_test.cpp +++ b/runtime/test/xbox_present_test.cpp @@ -320,7 +320,7 @@ int main() { EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner)))); Ref device; EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device), - reinterpret_cast(&device.p)))); + reinterpret_cast(&device.p), /*console_lists=*/false))); rt::d3d12::set_device_outer(inner, device.p); auto presenter = rt::d3d12::create_window_presenter(inner, window); EXPECT(presenter);