diff options
| author | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 21:07:05 +0000 |
|---|---|---|
| committer | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 21:07:05 +0000 |
| commit | a3425aa4e8a5081a8a59afa46c8d686b0be469af (patch) | |
| tree | ad581dc0d5df9e068d6d52b865d26c14bf8ed2a4 /runtime | |
| parent | a8011cf161de9a18acdf9eeb15a51e4e2444314c (diff) | |
| parent | 1d080f4a69605a330d75210f4390d65212383096 (diff) | |
Merge #7201 (latest head) into own/main
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/shims/d3d12_xs_device.cpp | 4 | ||||
| -rw-r--r-- | runtime/test/xs_proxy_mock_test.cpp | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/runtime/shims/d3d12_xs_device.cpp b/runtime/shims/d3d12_xs_device.cpp index e953f9dc1..cebf161c0 100644 --- a/runtime/shims/d3d12_xs_device.cpp +++ b/runtime/shims/d3d12_xs_device.cpp | |||
| @@ -3316,6 +3316,10 @@ std::uint64_t proxy_get_resource_allocation_info2(DeviceProxy* self, std::uint64 | |||
| 3316 | const auto count = static_cast<UINT>(a3); | 3316 | const auto count = static_cast<UINT>(a3); |
| 3317 | const auto* raw_descs = reinterpret_cast<const D3D12_RESOURCE_DESC*>(a4); | 3317 | const auto* raw_descs = reinterpret_cast<const D3D12_RESOURCE_DESC*>(a4); |
| 3318 | auto* info1 = reinterpret_cast<D3D12_RESOURCE_ALLOCATION_INFO1*>(a5); | 3318 | auto* info1 = reinterpret_cast<D3D12_RESOURCE_ALLOCATION_INFO1*>(a5); |
| 3319 | if (count > 0 && !raw_descs) { // a count with no descriptor array: refuse like the other bad-input paths | ||
| 3320 | *ret = {UINT64_MAX, 0}; | ||
| 3321 | return reinterpret_cast<std::uint64_t>(ret); | ||
| 3322 | } | ||
| 3319 | 3323 | ||
| 3320 | std::vector<D3D12_RESOURCE_DESC1> cleaned; | 3324 | std::vector<D3D12_RESOURCE_DESC1> cleaned; |
| 3321 | const D3D12_RESOURCE_DESC1* descs_to_pass = nullptr; | 3325 | const D3D12_RESOURCE_DESC1* descs_to_pass = nullptr; |
diff --git a/runtime/test/xs_proxy_mock_test.cpp b/runtime/test/xs_proxy_mock_test.cpp index 5cdd2ab9e..1c63895ca 100644 --- a/runtime/test/xs_proxy_mock_test.cpp +++ b/runtime/test/xs_proxy_mock_test.cpp | |||
| @@ -1566,6 +1566,12 @@ int check_xbox_slots() { | |||
| 1566 | EXPECT(mock->array[68][3] == ((static_cast<std::uint64_t>(D3D12_TEXTURE_LAYOUT_ROW_MAJOR) << 32) | | 1566 | EXPECT(mock->array[68][3] == ((static_cast<std::uint64_t>(D3D12_TEXTURE_LAYOUT_ROW_MAJOR) << 32) | |
| 1567 | static_cast<std::uint32_t>(D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS))); | 1567 | static_cast<std::uint32_t>(D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS))); |
| 1568 | 1568 | ||
| 1569 | // A count with a null descriptor array is refused with {UINT64_MAX, 0} and never reaches PC slot 68. | ||
| 1570 | D3D12_RESOURCE_ALLOCATION_INFO null_ret{}; | ||
| 1571 | EXPECT(call_slot108_c_abi(&null_ret, device, 1, 2, nullptr, nullptr) == &null_ret); | ||
| 1572 | EXPECT(null_ret.SizeInBytes == UINT64_MAX && null_ret.Alignment == 0); | ||
| 1573 | EXPECT(mock->calls[68] == 3 && xs::device_slot_hits(108) == 4); | ||
| 1574 | |||
| 1569 | EXPECT(release(allocator) == 0 && real_allocator->refs == 0); | 1575 | EXPECT(release(allocator) == 0 && real_allocator->refs == 0); |
| 1570 | EXPECT(release(queue) == 0); | 1576 | EXPECT(release(queue) == 0); |
| 1571 | EXPECT(release(device) == 0 && mock->refs == 0); | 1577 | EXPECT(release(device) == 0 && mock->refs == 0); |