From 88ed23f8d8323cef9aa5e28b5d94c4a8de758aed Mon Sep 17 00:00:00 2001 From: icecreammule277-dot <360389640+icecreammule277-dot@users.noreply.github.com> Date: Mon, 23 Nov 2026 17:41:45 -0500 Subject: [PATCH 1/3] fix: make main build again (3 hunks, 3 root causes) main a60e5eab5 does not compile the runtime. Three source-level breaks, all from the merge train: - d3d12_xs_device.cpp: Xbox slot 14's proxy calls rt::d3d12::create_console_descriptor_heap but the TU never sees it. Declared out of line rather than including d3d12_com.h, which pulls gfx10_descriptors.h/vulkan_backend.h into the standalone proxy tests that lack the Vulkan include path. - d3d12_vulkan_device.cpp: the helper needs a non-const DeviceState& (Device::state() is const) and the private Device::identity(); added a non-const state() overload and used the existing public holder(). - acphal.cpp: sizeof(SHAPE_XMA_CONTEXT) was 60 (assert 64) and sizeof(SHAPE_PCM_CONTEXT) 28 (assert 32). The repo ABI test asserts the GDK sizes 64/32, so the structs are one trailing dword short: reserved[10]->[11], reserved[1]->[2]. Verified: gta6rt and the whole target set build, except d3d12_console_descriptor_heap_test (separate break in the same commit: 2-arg create_device_proxy vs 3-arg, undefined Ref<>), left to its author. AI-assisted (OpenCode). (cherry picked from commit 100229ff16028803262b4cd8741f874a721c9b92) --- runtime/shims/acphal.cpp | 4 ++-- runtime/shims/d3d12_vulkan_device.cpp | 3 ++- runtime/shims/d3d12_xs_device.cpp | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/runtime/shims/acphal.cpp b/runtime/shims/acphal.cpp index 553f57f207..98ada97b0b 100644 --- a/runtime/shims/acphal.cpp +++ b/runtime/shims/acphal.cpp @@ -141,7 +141,7 @@ struct SHAPE_XMA_CONTEXT { uint32_t reserved1 : 6; uint32_t loopStartOffset : 26; uint32_t loopEndOffset : 6; - uint32_t reserved[10]; + uint32_t reserved[11]; }; static_assert(sizeof(SHAPE_XMA_CONTEXT) == 64, "SHAPE_XMA_CONTEXT is 64 bytes per GDK"); @@ -162,7 +162,7 @@ struct SHAPE_PCM_CONTEXT { uint32_t reserved6 : 15; uint32_t format : 2; uint32_t reserved7 : 14; - uint32_t reserved[1]; + uint32_t reserved[2]; }; static_assert(sizeof(SHAPE_PCM_CONTEXT) == 32, "SHAPE_PCM_CONTEXT is 32 bytes per GDK"); diff --git a/runtime/shims/d3d12_vulkan_device.cpp b/runtime/shims/d3d12_vulkan_device.cpp index a6911d0f4e..68c3dd888d 100644 --- a/runtime/shims/d3d12_vulkan_device.cpp +++ b/runtime/shims/d3d12_vulkan_device.cpp @@ -5499,6 +5499,7 @@ class Device final leonida::VulkanContext& context() { return *state_.context; } const leonida::BindlessSet* bindless() const { return state_.bindless.get(); } const DeviceState& state() const { return state_; } + DeviceState& state() { return state_; } IUnknown* holder() { return identity(); } bool bind_sampler(const leonida::gfx10::SamplerWords& words) { return state_.bind_sampler(words); } void own(const OwnedRuntime& owned) { owned_ = owned; } @@ -9999,7 +10000,7 @@ HRESULT create_console_descriptor_heap(ID3D12Device* device, const D3D12_DESCRIP if (!d) return E_INVALIDARG; auto* heap = new DescriptorHeap(d->state(), *desc, console_address, console_size); - heap->attach_device(d->identity()); + heap->attach_device(d->holder()); if (!heap->ok()) { heap->Release(); return E_OUTOFMEMORY; diff --git a/runtime/shims/d3d12_xs_device.cpp b/runtime/shims/d3d12_xs_device.cpp index 187406e3d8..6f88585f90 100644 --- a/runtime/shims/d3d12_xs_device.cpp +++ b/runtime/shims/d3d12_xs_device.cpp @@ -41,6 +41,16 @@ #include #include +// Xbox slot 14's console CreateDescriptorHeap helper: defined in d3d12_vulkan_device.cpp and declared in +// d3d12_com.h. Declared here instead of including d3d12_com.h, because that header pulls in gfx10_descriptors.h and +// vulkan_backend.h, and this translation unit is also compiled by the standalone proxy tests, which do not carry the +// Vulkan include path. +namespace rt::d3d12 { +HRESULT create_console_descriptor_heap(ID3D12Device* device, const D3D12_DESCRIPTOR_HEAP_DESC* desc, + D3D12_GPU_VIRTUAL_ADDRESS console_address, std::uint64_t console_size, + REFIID riid, void** out); +} // namespace rt::d3d12 + namespace rt::d3d12_xs { namespace { From c1e1c500b059b4b27e908e68588744612f75d168 Mon Sep 17 00:00:00 2001 From: icecreammule277-dot <360389640+icecreammule277-dot@users.noreply.github.com> Date: Mon, 23 Nov 2026 18:30:05 -0500 Subject: [PATCH 2/3] runtime: give the standalone proxy tests an inert create_console_descriptor_heap so they link The build fix turns the d3d12_xs_device.cpp compile error into a link error for root_sig_test/device_proxy_test/xs_proxy_mock_test (LNK2019). They compile d3d12_xs_device.cpp but do not link d3d12_vulkan_device.cpp where the slot-14 console helper lives. Add an inert E_NOTIMPL definition to those three targets only; the runtime links the real one. --- runtime/CMakeLists.txt | 3 +++ runtime/shims/d3d12_console_heap_stub.cpp | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 runtime/shims/d3d12_console_heap_stub.cpp diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index f317958f12..2c02af4436 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -166,6 +166,7 @@ if(WIN32 AND LEONIDA_BUILD_WINDOWS_RUNTIME) shims/registry.cpp shims/d3d12_xs.cpp shims/d3d12_xs_device.cpp + shims/d3d12_console_heap_stub.cpp ) target_link_libraries(root_sig_test PRIVATE gta6rt_d3d12_xs_rootsig ${D3D12_LIBRARY}) target_compile_definitions(root_sig_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) @@ -190,6 +191,7 @@ if(WIN32 AND LEONIDA_BUILD_WINDOWS_RUNTIME) shims/registry.cpp shims/d3d12_xs.cpp shims/d3d12_xs_device.cpp + shims/d3d12_console_heap_stub.cpp ) target_link_libraries(device_proxy_test PRIVATE gta6rt_d3d12_xs_rootsig ${D3D12_LIBRARY} ${DXGI_LIBRARY}) target_compile_definitions(device_proxy_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) @@ -203,6 +205,7 @@ if(WIN32 AND LEONIDA_BUILD_WINDOWS_RUNTIME) add_executable(xs_proxy_mock_test test/xs_proxy_mock_test.cpp shims/d3d12_xs_device.cpp + shims/d3d12_console_heap_stub.cpp ) target_compile_definitions(xs_proxy_mock_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) target_compile_options(xs_proxy_mock_test PRIVATE /W4 /permissive- /utf-8 /EHsc) diff --git a/runtime/shims/d3d12_console_heap_stub.cpp b/runtime/shims/d3d12_console_heap_stub.cpp new file mode 100644 index 0000000000..d2b45381fe --- /dev/null +++ b/runtime/shims/d3d12_console_heap_stub.cpp @@ -0,0 +1,22 @@ +// The standalone proxy tests (root_sig_test, device_proxy_test, xs_proxy_mock_test) compile shims/d3d12_xs_device.cpp, +// whose Xbox slot-14 console path calls rt::d3d12::create_console_descriptor_heap. The real definition lives in +// d3d12_vulkan_device.cpp, which those tests do not link (it pulls in the Vulkan device). They never create a console +// descriptor heap, so this inert definition satisfies the reference. The runtime links the real one instead. +#include +#include + +#include + +namespace rt::d3d12 { +HRESULT create_console_descriptor_heap(ID3D12Device* device, const D3D12_DESCRIPTOR_HEAP_DESC* desc, + D3D12_GPU_VIRTUAL_ADDRESS console_address, std::uint64_t console_size, + REFIID riid, void** out) { + (void)device; + (void)desc; + (void)console_address; + (void)console_size; + (void)riid; + if (out) *out = nullptr; + return E_NOTIMPL; +} +} // namespace rt::d3d12 From 7b31674e1ead28893b313d3b05f8b9ddac861c93 Mon Sep 17 00:00:00 2001 From: icecreammule277-dot <360389640+icecreammule277-dot@users.noreply.github.com> Date: Mon, 23 Nov 2026 18:52:54 -0500 Subject: [PATCH 3/3] runtime: give the remaining standalone d3d12_xs_device.cpp consumers the stub too Five more targets compile shims/d3d12_xs_device.cpp and do not link gta6rt_d3d12_com (the TU that defines the slot-14 console helper), so they hit the same LNK2019: pe_loader_test, test_pe_loader_bounds, pe_loader_fuzz, and d3d12_xs_root_signature_test (behind LEONIDA_D3D12_SHIM_TESTS). fsr_dispatch_test and bvh_builder_test already link gta6rt_d3d12_com, so they must NOT get the stub (it would be LNK2005) - verified both ways. With this, every configured consumer links. --- runtime/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 2c02af4436..435ccd091c 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -618,6 +618,7 @@ if(BUILD_TESTING) shims/xmem.cpp shims/d3d12_xs.cpp shims/d3d12_xs_device.cpp + shims/d3d12_console_heap_stub.cpp ) target_include_directories(pe_loader_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src @@ -759,6 +760,7 @@ if(BUILD_TESTING) shims/xmem.cpp shims/d3d12_xs.cpp shims/d3d12_xs_device.cpp + shims/d3d12_console_heap_stub.cpp ) target_include_directories(test_pe_loader_bounds PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src @@ -783,6 +785,7 @@ if(BUILD_TESTING) shims/xmem.cpp shims/d3d12_xs.cpp shims/d3d12_xs_device.cpp + shims/d3d12_console_heap_stub.cpp ) target_include_directories(pe_loader_fuzz PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src @@ -1305,6 +1308,7 @@ if(LEONIDA_D3D12_SHIM_TESTS) shims/d3d12_xs.cpp shims/registry.cpp shims/d3d12_xs_device.cpp + shims/d3d12_console_heap_stub.cpp ) target_include_directories(d3d12_xs_root_signature_test PRIVATE shims) target_compile_definitions(d3d12_xs_root_signature_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)