mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #1893] [CLOSED] replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED) #1904
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#1904
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/1893
Author: @OreoFR
Created: 11/25/2026
Status: ❌ Closed
Base:
main← Head:rt-depth-format-copy-staged📝 Commits (1)
daf31b8replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED)📊 Changes
3 files changed (+103 additions, -2 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+7 -0)📝
runtime/src/vulkan_replay.h(+23 -1)📝
runtime/test/replay_copy_offset_test.cpp(+73 -1)📄 Description
Claimed in the coordination issue as: RT-DEPTH-FORMAT-COPY-STAGED (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7165740106)
What and why
A
CopyTextureRegionof the depth plane from aD32_SFLOAT_S8_UINTimage into aD32_SFLOATone (D3D12:D32_FLOAT_S8X24andD32_FLOAT) was replayed asvkCmdCopyImage. Vulkan requires depth/stencil formats to match exactly (VUID-vkCmdCopyImage-srcImage-01548). The NVIDIA driver runs the copy anyway and writes past the end of the D32 image.That is the world-start
WRITE_INVALIDdevice loss ("crash A"):VK_EXT_device_address_binding_report, the fault address is the first byte after a 2560x1440D32_SFLOATimage (bound size0xF00000); the next binding starts 64 KiB later (finding: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7164893397);LEONIDA_VK_VALIDATION=1, this VUID for exactly that pair is reported just before the loss.depth_format_pair(new,runtime/src/vulkan_replay.h): two depth formats with the same depth encoding but not the sameVkFormat(D32_SFLOAT/D32_SFLOAT_S8_UINT,D16_UNORM/D16_UNORM_S8_UINT,X8_D24_UNORM_PACK32/D24_UNORM_S8_UINT) now take the image → transfer scratch → image path that depth ↔ colour and the two A8 backings already use. In a buffer the depth aspect has the same texel layout on both sides (4 bytes for D32). A whole-resource copy between such a pair was already refused before this point (the aspects differ), so only the depth-planeCopyTextureRegionchanges.Tested
replay_copy_offset_test(no GPU, fake Vulkan callbacks), new case: D32S8 → D32 and D32 → D32S8 depth-plane copies are staged (novkCmdCopyImage, depth aspect on both halves, 4 bytes a texel), and D32 → D32 keepsvkCmdCopyImage. It fails without the change (6 checks) and passes with it. Built with MSVC 19.44.scripts/check_no_game_data.pyon the changed files, andtests/test_text_write_line_endings.py: OK.LEONIDA_ASYNC_PIPELINES=1,LEONIDA_DEVICE_FAULT=1, counts only:ExecuteCommandLists), with host image copies off plus #1827, #1849 and #1698;ExecuteCommandLists); one of them under validation, which no longer reported the copy;mainalone (host image copies on, the default): no crash A; that run stopped at ~266 s with the other known stop ("crash B",lib_cs_01144in flight, a type-4-only fault report), which #1849 addresses;ExecuteCommandLists).Not shown yet: these are few runs on one machine. Whether host image copies can stay on by default on NVIDIA (#1810, #1851) needs more runs with them on; I'm doing those and will report in #1608. After crash A, the next stop here is a list-values gate stall (gates time out, frames drop to 0), which this change doesn't address.
Depends on: none.
AI-assisted (Claude Code).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.