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..812215b628 100644 --- a/runtime/shims/d3d12_xs_device.cpp +++ b/runtime/shims/d3d12_xs_device.cpp @@ -25,6 +25,9 @@ #include "d3d12_xs_device.h" #include "d3d12_trace.h" #include "../src/shader_library.h" // leonida::fspx_payload_from_parts for slot 67 +#ifdef LEONIDA_VULKAN_DEVICE +#include "d3d12_com.h" +#endif #include #include @@ -1601,12 +1604,14 @@ HRESULT proxy_create_descriptor_heap(DeviceProxy* self, const D3D12_DESCRIPTOR_H std::memcpy(&size, bytes + sizeof(D3D12_DESCRIPTOR_HEAP_DESC) + sizeof(address), sizeof(size)); // Console-extended slot 14 (issue #313): address/size follow the PC desc. Only take this path when a // non-zero console VA is present; normal PC 16-byte descs never enter it. +#ifdef LEONIDA_VULKAN_DEVICE if (address != 0) { console_extended = true; hr = rt::d3d12::create_console_descriptor_heap( self->real, desc, static_cast(address), size, __uuidof(ID3D12DescriptorHeap), &created); } +#endif } } if (!console_extended) diff --git a/runtime/test/d3d12_console_descriptor_heap_test.cpp b/runtime/test/d3d12_console_descriptor_heap_test.cpp index 5f694b5a2a..da24f7447b 100644 --- a/runtime/test/d3d12_console_descriptor_heap_test.cpp +++ b/runtime/test/d3d12_console_descriptor_heap_test.cpp @@ -24,6 +24,7 @@ struct Ref { return &p; } T* get() const { return p; } + T* operator->() const { return p; } }; bool check_console_addressed_heap(ID3D12Device* device) { @@ -64,13 +65,11 @@ bool check_console_addressed_heap(ID3D12Device* device) { } bool check_xs_proxy_slot14(ID3D12Device* real_device) { - void* proxy_raw = nullptr; - if (FAILED(rt::d3d12_xs::create_device_proxy(real_device, IID_PPV_ARGS(&proxy_raw))) || !proxy_raw) { + Ref proxy; + if (FAILED(rt::d3d12_xs::create_device_proxy(real_device, IID_PPV_ARGS(proxy.put()))) || !proxy.get()) { std::fprintf(stderr, "create_device_proxy failed\n"); return false; } - Ref proxy; - proxy.p = static_cast(proxy_raw); struct ConsoleDescriptorHeapDesc { D3D12_DESCRIPTOR_HEAP_DESC desc{};