mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #588] d3d12: the Xbox D16_UNORM_S8_UINT depth format (118) and its plane views (RT-XBOX-D16S8) #632
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#632
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/588
Author: @MrCloudy2
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:rt-d16s8📝 Commits (1)
df1bb7cd3d12: the Xbox D16_UNORM_S8_UINT depth format (118) and its plane views (RT-XBOX-D16S8)📊 Changes
4 files changed (+243 additions, -3 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+10 -0)📝
runtime/CMakeLists.txt(+8 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+40 -3)➕
runtime/test/d3d12_xbox_d16s8_test.cpp(+185 -0)📄 Description
Claimed in the coordination issue as: RT-XBOX-D16S8 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7127190120)
What and why
DXGI_FORMAT 118, past
B4G4R4A4_UNORM, is the console'sD16_UNORM_S8_UINT. Its plane views are 119R16_UNORM_X8_TYPELESS(depth) and 120X16_TYPELESS_G8_UINT(stencil). #461's XG layout table treats 118–120 as one 2-byte depth family too.The Vulkan-backed device knew none of them, so two things failed:
GetResourceAllocationInfogaveUINT64_MAXfor a 118 depth buffer. The retail executable sizes one at start-up and asserts on that answer.DSVFormat = 118were refused (depth-stencil format not supported: 118).Vulkan's
D16_UNORM_S8_UINTis missing on NVIDIA and RADV, so a 118 texture is aD32_SFLOAT_S8_UINTimage on every GPU. A 16-bit depth value is held as a float and read back through the depth view as the same [0, 1] value.vulkan_format: 118 →D32_SFLOAT_S8_UINT, depth and stencil aspects.format_familyanddepth_stencil_family: 118–120 form one depth-stencil family. Creation withALLOW_DEPTH_STENCILand a 118 clear value passes.image_descriptor: 119 (orUNKNOWN) is 118's depth-plane SRV format, and 120 is its stencil-plane format.CheckFeatureSupport:FORMAT_INFOgives two planes for all three formats.FORMAT_SUPPORTanswers with the D32S8 family's answers and gives the caller itsFormatback.docs/d3d12_vulkan.md: a paragraph next to the D24-as-D32 one.Not done (documented): a footprint copy of the depth plane has the D32 texel size, 4 bytes instead of 2. There is no conversion pass as there is for D24, and nothing measured makes such a copy yet.
Tested
d3d12_xbox_d16s8_test(CTestd3d12_xbox_d16s8): passes. It checks:UNKNOWNDSV, run to the fence.d3d12_d24_support: passes.d3d12_typeless_depthfails the same way with and without this change: it compares against WARP, which Wine lacks.git merge-tree).GPUs tested: NVIDIA GeForce RTX 3060, driver 620.73.04, Linux (CachyOS, kernel 7.3), Wine 11.22 staging
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).scripts/check_no_game_data.pypasses over every changed file.docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.