[PR #1905] replay: depth copies between different encodings are left out, stencil planes staged (RT-DEPTH-COPY-ENCODING-MISMATCH) #1914

Open
opened 2026-11-26 21:19:23 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1905
Author: @Snooozs
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: depth-copy-encodings


📝 Commits (2)

  • daf31b8 replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED)
  • 365b8ff replay: depth copies between encodings are left out, stencil planes staged (RT-DEPTH-COPY-ENCODING-MISMATCH)

📊 Changes

3 files changed (+184 additions, -3 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+11 -0)
📝 runtime/src/vulkan_replay.h (+61 -2)
📝 runtime/test/replay_copy_offset_test.cpp (+112 -1)

📄 Description

Claimed in the coordination issue as: RT-DEPTH-COPY-ENCODING-MISMATCH (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7166819597). The follow-up to #1893 that @OreoFR left to me.

Depends on: #1893 (this branch contains its commit; the diff to review is the last commit).

What and why

vkCmdCopyImage accepts depth/stencil images only when their formats are equal (VUID-vkCmdCopyImage-srcImage-01548), whichever aspect is copied. #1893 stages the depth plane between formats of one encoding. Three cases were still handed to the driver:

  • Depth planes of different encodings (D24_UNORM_S8_UINT into D16_UNORM or D32_SFLOAT, D32_SFLOAT_S8_UINT into D16_UNORM): D3D12 has no such copy, but the layer can make one out of a legal console copy, since the console's D16S8 is made as D24S8 on NVIDIA. That one copy is now left out and logged (at most 8 lines), and the list still replays; refusing it would drop the whole submission. A converting copy can replace this if a title is ever seen asking for it.
  • The stencil plane between different depth-stencil formats (8 bits in each): staged, as the depth plane is.
  • A multisampled pair: #1893 would stage it, but vkCmdCopyImageToBuffer takes no multisampled image. Left out, as above.

depth_stencil_copy makes the choice; nothing changes for equal formats, colour copies or depth to colour.

Tested

  • replay_copy_offset_test (no GPU), new cases: exit 0 with the change; with vulkan_replay.h of #1893 under the same test 7 checks fail (five left-out pairs, the staged stencil plane, its scratch size).
  • Windows 10 Pro 19045, NVIDIA GeForce RTX 5060 Ti, driver 621.01, MSVC 14.43 RelWithDebInfo: vk_command_replay, d3d12_noop_copy, d3d12_clear, d3d12_depth_resolve, d3d12_typeless_depth, d3d12_subresource_copy, xbox_depth_storage, d3d12_copy_xfmt, d3d12_a8_copy, d3d12_stencil_copy, d3d12_depth24_draw, replay_copy_offset: 12 of 12 pass.
  • scripts/check_no_game_data.py on the changed files: OK.
  • Not run: the whole ctest set, a retail boot with this commit, AMD or Intel. Whether the retail title makes any of these copies is not known.

AI-assisted: yes (Claude Code).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1905 **Author:** [@Snooozs](https://github.com/Snooozs) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `depth-copy-encodings` --- ### 📝 Commits (2) - [`daf31b8`](https://github.com/ubiquitarianism/leonida/commit/daf31b820b5b9fe5d7d119836657bff1f8fd1ea0) replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED) - [`365b8ff`](https://github.com/ubiquitarianism/leonida/commit/365b8ff08007aa8dccaa5c5e4b5e5f11fc5784ac) replay: depth copies between encodings are left out, stencil planes staged (RT-DEPTH-COPY-ENCODING-MISMATCH) ### 📊 Changes **3 files changed** (+184 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+11 -0) 📝 `runtime/src/vulkan_replay.h` (+61 -2) 📝 `runtime/test/replay_copy_offset_test.cpp` (+112 -1) </details> ### 📄 Description Claimed in the coordination issue as: RT-DEPTH-COPY-ENCODING-MISMATCH (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7166819597). The follow-up to #1893 that @OreoFR left to me. Depends on: #1893 (this branch contains its commit; the diff to review is the last commit). ### What and why `vkCmdCopyImage` accepts depth/stencil images only when their formats are equal (`VUID-vkCmdCopyImage-srcImage-01548`), whichever aspect is copied. #1893 stages the depth plane between formats of one encoding. Three cases were still handed to the driver: - **Depth planes of different encodings** (`D24_UNORM_S8_UINT` into `D16_UNORM` or `D32_SFLOAT`, `D32_SFLOAT_S8_UINT` into `D16_UNORM`): D3D12 has no such copy, but the layer can make one out of a legal console copy, since the console's D16S8 is made as D24S8 on NVIDIA. That one copy is now left out and logged (at most 8 lines), and the list still replays; refusing it would drop the whole submission. A converting copy can replace this if a title is ever seen asking for it. - **The stencil plane between different depth-stencil formats** (8 bits in each): staged, as the depth plane is. - **A multisampled pair**: #1893 would stage it, but `vkCmdCopyImageToBuffer` takes no multisampled image. Left out, as above. `depth_stencil_copy` makes the choice; nothing changes for equal formats, colour copies or depth to colour. ### Tested - `replay_copy_offset_test` (no GPU), new cases: exit 0 with the change; with `vulkan_replay.h` of #1893 under the same test **7 checks fail** (five left-out pairs, the staged stencil plane, its scratch size). - Windows 10 Pro 19045, NVIDIA GeForce RTX 5060 Ti, driver 621.01, MSVC 14.43 RelWithDebInfo: `vk_command_replay`, `d3d12_noop_copy`, `d3d12_clear`, `d3d12_depth_resolve`, `d3d12_typeless_depth`, `d3d12_subresource_copy`, `xbox_depth_storage`, `d3d12_copy_xfmt`, `d3d12_a8_copy`, `d3d12_stencil_copy`, `d3d12_depth24_draw`, `replay_copy_offset`: 12 of 12 pass. - `scripts/check_no_game_data.py` on the changed files: OK. - Not run: the whole `ctest` set, a retail boot with this commit, AMD or Intel. Whether the retail title makes any of these copies is not known. AI-assisted: yes (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1914
No description provided.