mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:40:52 +01:00
[PR #961] [CLOSED] d3d12_xs: a console volume depth-stencil is a 2D depth array (RT-VOLUME-DEPTH) #998
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#998
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/961
Author: @roanh47
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:pr/volume-depth📝 Commits (10+)
522faa2d3d12_xs: honour XMemAllocationHooks for descriptor heaps and translate CPU handlesf59167ed3d12_xs: device slot 25 pads a render target to whole console tiles (RT-5 stop 17)6b75cbad3d12_xs: device slot 25 gives the PC device clean resource descriptions (RT-5 stop 16)8eaccded3d12_xs: console render target sizes follow each resource's alignment, slot 56 offsets, full mip chains, rounded-up mip extents, B5G5R5A1, saturating sumse090be9d3d12_xs: committed resources lease their size through the title's XMem hooks (RT-5 stop 17)24914e7d3d12: preserve PC descriptor validation in slot 254056d18ladder: kXboxTiledResourceLayout is inline const, not constexpr (clang-cl rejects 0x101 for the unfixed enum)c108c53d3d12_xs: the console render-target sizes of slots 25 and 56 are for console-form calls only0c5a146d3d12_xs: the hook-backed descriptor address is not applied to a console-extended heapc8247cdd3d12_xs: a console indirect argument of type 105 is created as DISPATCH (slot 41)📊 Changes
23 files changed (+2706 additions, -134 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+31 -2)📝
runtime/CMakeLists.txt(+1 -0)📝
runtime/shims/d3d12_com.cpp(+10 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+5 -0)📝
runtime/shims/d3d12_xs.cpp(+17 -0)➕
runtime/shims/d3d12_xs_alloc_size.h(+156 -0)➕
runtime/shims/d3d12_xs_desc_clean.h(+77 -0)📝
runtime/shims/d3d12_xs_device.cpp(+972 -63)📝
runtime/shims/d3d12_xs_device.h(+58 -11)📝
runtime/shims/registry.cpp(+39 -0)📝
runtime/shims/shims.h(+13 -0)📝
runtime/shims/xbox_present.cpp(+3 -2)📝
runtime/shims/xbox_present.h(+2 -1)📝
runtime/src/command_list.h(+3 -0)📝
runtime/src/frame_pacer.h(+19 -6)📝
runtime/src/pe_loader.cpp(+7 -0)📝
runtime/test/allocator_proxy_test.cpp(+24 -7)📝
runtime/test/d3d12_mesh_test.cpp(+22 -0)📝
runtime/test/device_proxy_test.cpp(+114 -1)📝
runtime/test/frame_pacer_test.cpp(+19 -0)...and 3 more files
📄 Description
Claimed in the coordination issue as: RT-VOLUME-DEPTH
Depends on: #427 and #772. This branch is based on #772's head
cbdaf7ece, which contains #427's89fdb83e0; #427 addsruntime/shims/d3d12_xs_desc_clean.hand the slot-25 descriptor copy, and #772 touches slots 127 and 133. The volume-depth helper is now part of #427's header instead of a second copy of it. This PR's own commit ise0b962d89, the last one in the diff; the earlier commits are that stack (based onmaina28927849), which is itself behind today'smain, so the stack is not mergeable until #427/#772 are. A test merge with today'smainconflicts only where that stack meets newermainchanges (docs/d3d12_vulkan.md,runtime/shims/d3d12_xs_device.cpp/.h,runtime/src/frame_pacer.hand the list inxs_proxy_mock_test.cpp'smain); this commit's hunks apply on top of #772.What and why
The current native Windows/RTX 3070 stop after #517 is
ID3D12Device10::CreateCommittedResource3refusing aTEXTURE3D 768x768x6 R16_TYPELESS, one mip, one sample,ALLOW_DEPTH_STENCILresource. PC D3D12 has no volume depth-stencil: the layer'sGetResourceAllocationInfoanswersUINT64_MAXandCreateCommittedResource3fails.On top of #427's
d3d12_xs_desc_clean.h, two small functions describe exactly that measured resource as aTEXTURE2Ddepth array of the same six slices:is_measured_volume_depth:Dimension == TEXTURE3D,ALLOW_DEPTH_STENCIL,MipLevels == 1,SampleDesc.Count == 1,DepthOrArraySize == 6;pc_depth_desc: a copy withDimensionchanged toTEXTURE2D;DepthOrArraySizeis already the slice count.Called where the PC device is handed a description:
GetResourceAllocationInfo): inside #427's existing descriptor copy, before the size query, so sizing and creation agree;CreateCommittedResource), slot 127 (CreateCommittedResource3) and the slot 133 (CreatePlacedResourceX) handler: on the existing copy before the PC call.Preserved exactly: the format (
R16_TYPELESS, still typeless in the depth-stencil family),ALLOW_DEPTH_STENCIL, the clear value the caller passes,MipLevels,SampleDesc, width, height and the six array slices. The caller's descriptor is never written.Deliberately not translated:
xs_proxy_mock_testproves a four-slice, a two-mip and a colour volume keepTEXTURE3D;d3d12_vulkan_device.cpp, which is unchanged;GetResourceAllocationInfo2): it is not routed in this stack'sd3d12_xs_device.cpp, so there is no call site to change.d3d12_vulkan_device_testis not modified in this version: its depth-stencil volume case is four slices, outside the measured shape, and still matches the host runtime.Tested
MSVC 19.44 (
RelWithDebInfo,Visual Studio 17 2022, x64, Windows SDK 10.0.26100), Vulkan SDK 1.4.363.0, on the rebased branch:The new regression's own lines:
It checks the descriptor through slot 25 (including a two-entry list), slots 76 and 127 and the slot 133 handler, asserts the caller's
D3D12_RESOURCE_DESC/DESC1is byte-identical after every call, and that the four-slice, multi-mip and colour volumes are not converted.The other tests' closing lines:
One intermediate
ctestrun ofd3d12_vulkan_devicefailed once on this stack; it passed when run alone and in the next full run above (noline N:failure printed in the direct run).python -I scripts/check_no_game_data.py runtime/shims/d3d12_xs_desc_clean.h runtime/shims/d3d12_xs_device.cpp runtime/shims/d3d12_xs_device.h runtime/test/xs_proxy_mock_test.cppexits 0 with no output.No game data is in the change: every descriptor in the tests is hand-written, and no log or report quotes the title.
GPUs tested: NVIDIA GeForce RTX 3070, driver 610.88, Windows 11 Pro.
AI-assisted: yes (DeepSeek v4.1 Flash 1017).
Checklist
cbdaf7ece, onmaina28927849) and merges cleanly once they do.docs/design.md— not a translator change.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.