Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions runtime/shims/acphal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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");

Expand Down
3 changes: 2 additions & 1 deletion runtime/shims/d3d12_vulkan_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions runtime/shims/d3d12_xs_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <windows.h>
#include <dxgi1_4.h>
Expand Down Expand Up @@ -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<D3D12_GPU_VIRTUAL_ADDRESS>(address), size,
__uuidof(ID3D12DescriptorHeap), &created);
}
#endif
}
}
if (!console_extended)
Expand Down
7 changes: 3 additions & 4 deletions runtime/test/d3d12_console_descriptor_heap_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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<ID3D12Device> 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<ID3D12Device> proxy;
proxy.p = static_cast<ID3D12Device*>(proxy_raw);

struct ConsoleDescriptorHeapDesc {
D3D12_DESCRIPTOR_HEAP_DESC desc{};
Expand Down