diff options
| author | aslan2142 <jan.trencansky@protonmail.com> | 2026-11-24 23:12:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-24 23:12:58 +0100 |
| commit | 9f25f1ef2c9000c3d463bc4f5358cfcfd41a0c76 (patch) | |
| tree | 38576e24c770a740bcc0dc602491d20a5b5feec5 /docs | |
| parent | 540d5111fd0bb7663e2c9c2eb17234be1d34d2ad (diff) | |
| parent | d15a916010d442c1b1cb0e1812991a693f069624 (diff) | |
Merge pull request #375 from Mumogg/xmem-hooks-sizes-lease
d3d12_xs: the title's XMem hooks, console render-target sizes and resource leases, again (RT-XMEM-LEASE)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/d3d12_vulkan.md | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md index 90828d409..fb96b4595 100644 --- a/docs/d3d12_vulkan.md +++ b/docs/d3d12_vulkan.md | |||
| @@ -2263,6 +2263,30 @@ The trace will enumerate them. | |||
| 2263 | Intel Raptor Lake-S (101.7092) and RTX 5060 Laptop (621.24) hosts wrap, two 2^63 buffers to 0, and WARP on that | 2263 | Intel Raptor Lake-S (101.7092) and RTX 5060 Laptop (621.24) hosts wrap, two 2^63 buffers to 0, and WARP on that |
| 2264 | PC still saturates. A wrapped total could make a caller allocate less than one of its resources, so the layer | 2264 | PC still saturates. A wrapped total could make a caller allocate less than one of its resources, so the layer |
| 2265 | keeps saturating, and the test accepts a host that wraps. | 2265 | keeps saturating, and the test accepts a host that wraps. |
| 2266 | Behind the Xbox-ABI proxy (device slots 25 and 56) a 2D render target of a listed colour format with one sample is | ||
| 2267 | padded to whole console tiles: the size is the sum over its mips (MipLevels 0 is the full chain, an odd extent | ||
| 2268 | rounds up), each mip rounded up to the RDNA2 SW_64KB_D tile shape (`runtime/src/gfx10_tiling.h`: 256 x 128 pixels | ||
| 2269 | for 2-byte elements, 128 x 128 for 4-byte, 128 x 64 for 8-byte, 64 x 64 for 16-byte), with the first mip that fits | ||
| 2270 | in half a tile's width and a whole tile's height, and the mips after it, sharing one tail tile, times the array | ||
| 2271 | size. A 1920 x 1080 RGBA8 target is 135 tiles, 8,847,360 bytes, where the PC answer is 8,323,072. The proxy lays | ||
| 2272 | the descriptions out as the PC device does (each at its own alignment, the total rounded up to the largest | ||
| 2273 | alignment, sums saturating) with each render target at the larger of its console size and its PC size; a 4 MiB | ||
| 2274 | aligned multisampled neighbour therefore keeps its place (a 1 x 1 four-sample target and a 1080p target need 16 MiB, | ||
| 2275 | not 12.5). Slot 56 reports the same offsets. The PC layout stands when no description grows | ||
| 2276 | (`d3d12_xs_alloc_size.h`; `xs_proxy_mock_test`). **Assumption**: the | ||
| 2277 | retail title's own sizes are not measured (#6982, stop 17), so that its allocation is these shapes and no DCC or | ||
| 2278 | CMask memory is open until they are. | ||
| 2279 | The descriptions the title passes to slot 25 carry console values (layout word `0x101`/`0x1`, flag bits above the PC | ||
| 2280 | ones). For console-form calls or descriptors explicitly using layout `0x101`, the proxy strips Xbox-only flags and | ||
| 2281 | translates layout `0x101` to ROW_MAJOR for buffers or UNKNOWN for textures. Other PC-form descriptors reach the host | ||
| 2282 | unchanged for validation (`d3d12_xs_desc_clean.h`; #6982 section 3.7). | ||
| 2283 | A committed resource made through slots 76 and 127 also allocates that size through the title's | ||
| 2284 | `__XMemAllocationHooks__`, as the console runtime's `XMemAlloc` for the resource does, and frees it when the | ||
| 2285 | resource is destroyed (a lease kept with `SetPrivateDataInterface`; the bytes are not used). The retail title | ||
| 2286 | budgets its first full-screen render targets with such a hook: it bump-allocates the allocations whose XALLOC | ||
| 2287 | page-size field is 2 out of a range it reserved and asserts that less than 2 MiB is left (RT-5 stop 17). The | ||
| 2288 | lease's attribute word (allocator ID 0x80, page-size field 2, object type 0) is an **assumption**; the measured | ||
| 2289 | hook reads only the page-size field. | ||
| 2266 | - `GetAdapterLuid` (implemented): `VkPhysicalDeviceIDProperties::deviceLUID`, which on Windows is the DXGI | 2290 | - `GetAdapterLuid` (implemented): `VkPhysicalDeviceIDProperties::deviceLUID`, which on Windows is the DXGI |
| 2267 | adapter's LUID; `d3d12_fence_timing_test` finds it with `IDXGIFactory4::EnumAdapterByLuid` (RTX 4090, driver | 2291 | adapter's LUID; `d3d12_fence_timing_test` finds it with `IDXGIFactory4::EnumAdapterByLuid` (RTX 4090, driver |
| 2268 | 621.14). A driver that reports `deviceLUIDValid = VK_FALSE` gets a zero LUID, logged. | 2292 | 621.14). A driver that reports `deviceLUIDValid = VK_FALSE` gets a zero LUID, logged. |
| @@ -2279,8 +2303,9 @@ The trace will enumerate them. | |||
| 2279 | RDX, node mask in R8 and heap type in R9: three calls right after device creation, node mask 1 and types 1, 2 | 2303 | RDX, node mask in R8 and heap type in R9: three calls right after device creation, node mask 1 and types 1, 2 |
| 2280 | and 3 (measured under `gta6rt --run` with a register probe in the slot's thunk). A PC C++ method has the device | 2304 | and 3 (measured under `gta6rt --run` with a register probe in the slot's thunk). A PC C++ method has the device |
| 2281 | in RCX and the buffer in RDX, so the Xbox-ABI proxy takes the console form when RDX holds the proxy | 2305 | in RCX and the buffer in RDX, so the Xbox-ABI proxy takes the console form when RDX holds the proxy |
| 2282 | (`d3d12_xs_device.cpp`; `xs_proxy_mock_test`, `device_proxy_test`). Slots 25 and 43 return structs too; the | 2306 | (`d3d12_xs_device.cpp`; `xs_proxy_mock_test`, `device_proxy_test`). Slot 43 returns a struct too and the |
| 2283 | executable has not been seen calling them yet, so the proxy still forwards them in the PC form. | 2307 | proxy still forwards it in the PC form: no call of slot 43 has been seen. Slots 25 and 56 take the same form by the |
| 2308 | same rule (reported later in the boot, #6982; not measured), as #6973 first did for slot 25. | ||
| 2284 | - Residency and power (D3D-33) are no-ops that still check their arguments (`d3d12_vulkan_device.cpp`, tested in | 2309 | - Residency and power (D3D-33) are no-ops that still check their arguments (`d3d12_vulkan_device.cpp`, tested in |
| 2285 | `d3d12_vulkan_device_test`). Vulkan has no residency API: memory from `vkAllocateMemory` stays usable until | 2310 | `d3d12_vulkan_device_test`). Vulkan has no residency API: memory from `vkAllocateMemory` stays usable until |
| 2286 | `vkFreeMemory`, and paging under pressure is the kernel driver's job, so every pageable object is always resident. | 2311 | `vkFreeMemory`, and paging under pressure is the kernel driver's job, so every pageable object is always resident. |