[PR #428] [CLOSED] d3d12: A8_UNORM render targets through VK_FORMAT_A8_UNORM_KHR, again (RT-A8-TARGET) #478

Closed
opened 2026-11-26 20:18:01 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/428
Author: @Mumogg
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: a8-render-target


📝 Commits (2)

  • 2e4beef d3d12: A8_UNORM render targets through VK_FORMAT_A8_UNORM_KHR (VK_KHR_maintenance5)
  • 49b750a d3d12: an A8 render target's castable list takes its own format and refuses the others

📊 Changes

10 files changed (+316 additions, -22 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+9 -1)
📝 runtime/shims/d3d12_com.h (+3 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+75 -12)
📝 runtime/src/gfx10_descriptors.h (+4 -0)
📝 runtime/src/vulkan_replay.h (+8 -1)
📝 runtime/test/d3d12_clear_formats_test.cpp (+2 -0)
📝 runtime/test/d3d12_descriptor_test.cpp (+53 -7)
📝 runtime/test/d3d12_draw_test.cpp (+113 -0)
📝 runtime/test/gfx10_descriptors_test.cpp (+20 -1)
📝 runtime/test/vk_test_device.h (+29 -0)

📄 Description

Claimed in #14 as RT-A8-TARGET. Independent of my other open pull requests: it is based on main alone and touches the Vulkan layer, not the proxy.

What and why

The retail title's first native pipelines name an A8_UNORM render target, and it sizes one at 3840 x 2160 through device slot 25. main stores every A8_UNORM texture as R8_UNORM and refuses it as a render target: the log says GetResourceAllocationInfo format not supported yet: 65, slot 25 answers UINT64_MAX, and a worker thread of the title stops on its own int3.

Two commits by mrp1no (-x, authorship kept; ancestors of main whose content is not in the tree):

  • 67950a8d5: where the GPU has VK_KHR_maintenance5 and can sample VK_FORMAT_A8_UNORM_KHR and blend it as a colour attachment, an A8_UNORM texture created with ALLOW_RENDER_TARGET is stored in that format; its views, the format support answers and the copy paths follow. Other A8_UNORM textures stay R8_UNORM, and a device without the format refuses A8 render targets as before.
  • 18b0bfbaf: an A8 render target's castable list takes its own format and refuses the others.

The first commit conflicted in two places. In d3d12_vulkan_device.cpp it was written against the older r9g9b9e5_as_r32_uint member that main has since replaced with uint_backed: I kept main's member and added only the commit's a8_as_alpha next to it, and in the render-target-view code the A8 case goes before main's uint_backed cases. In vk_test_device.h both extensions are enabled.

Measured

Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08, has VK_KHR_maintenance5), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off. The boot runs are on main ece4ba5b3 with my stacked pull requests and #142, #219, #328 and #387, because the stop is only reached that far in.

--run Traced calls CreatePipelineState ok Ends with
without this 12,043 6 the worker thread's int3 on the refused size
with this 62,596 50,450 a call through a null pointer, during the pipeline creations

So this is what lets the title go on to create its pipelines on this path. The null call that ends the run is a queue method forwarded to the wrong PC method; that is my pull request for RT-QUEUE-SIGNAL.

Tests under Wine, the four the first commit touches:

Test Result
d3d12_descriptor passed
d3d12_draw passed
gfx10_descriptors passed
d3d12_clear_formats failed, as it does on plain main under this Wine

Not built with MSVC and not run on Windows, and not run on a GPU without VK_KHR_maintenance5.

AI-assisted (Claude Code); built and run on the machine above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt


🔄 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/428 **Author:** [@Mumogg](https://github.com/Mumogg) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `a8-render-target` --- ### 📝 Commits (2) - [`2e4beef`](https://github.com/ubiquitarianism/leonida/commit/2e4beefdc25e723b2eca9fde154fb0572b38f6ce) d3d12: A8_UNORM render targets through VK_FORMAT_A8_UNORM_KHR (VK_KHR_maintenance5) - [`49b750a`](https://github.com/ubiquitarianism/leonida/commit/49b750a950409529412d67cb79823e2a4373bc41) d3d12: an A8 render target's castable list takes its own format and refuses the others ### 📊 Changes **10 files changed** (+316 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+9 -1) 📝 `runtime/shims/d3d12_com.h` (+3 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+75 -12) 📝 `runtime/src/gfx10_descriptors.h` (+4 -0) 📝 `runtime/src/vulkan_replay.h` (+8 -1) 📝 `runtime/test/d3d12_clear_formats_test.cpp` (+2 -0) 📝 `runtime/test/d3d12_descriptor_test.cpp` (+53 -7) 📝 `runtime/test/d3d12_draw_test.cpp` (+113 -0) 📝 `runtime/test/gfx10_descriptors_test.cpp` (+20 -1) 📝 `runtime/test/vk_test_device.h` (+29 -0) </details> ### 📄 Description Claimed in #14 as `RT-A8-TARGET`. Independent of my other open pull requests: it is based on `main` alone and touches the Vulkan layer, not the proxy. ### What and why The retail title's first native pipelines name an A8_UNORM render target, and it sizes one at 3840 x 2160 through device slot 25. `main` stores every A8_UNORM texture as R8_UNORM and refuses it as a render target: the log says `GetResourceAllocationInfo format not supported yet: 65`, slot 25 answers `UINT64_MAX`, and a worker thread of the title stops on its own `int3`. Two commits by mrp1no (`-x`, authorship kept; ancestors of `main` whose content is not in the tree): - `67950a8d5`: where the GPU has `VK_KHR_maintenance5` and can sample `VK_FORMAT_A8_UNORM_KHR` and blend it as a colour attachment, an A8_UNORM texture created with `ALLOW_RENDER_TARGET` is stored in that format; its views, the format support answers and the copy paths follow. Other A8_UNORM textures stay R8_UNORM, and a device without the format refuses A8 render targets as before. - `18b0bfbaf`: an A8 render target's castable list takes its own format and refuses the others. The first commit conflicted in two places. In `d3d12_vulkan_device.cpp` it was written against the older `r9g9b9e5_as_r32_uint` member that `main` has since replaced with `uint_backed`: I kept `main`'s member and added only the commit's `a8_as_alpha` next to it, and in the render-target-view code the A8 case goes before `main`'s `uint_backed` cases. In `vk_test_device.h` both extensions are enabled. ### Measured Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08, has `VK_KHR_maintenance5`), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off. The boot runs are on `main` `ece4ba5b3` with my stacked pull requests and #142, #219, #328 and #387, because the stop is only reached that far in. | `--run` | Traced calls | `CreatePipelineState ok` | Ends with | |---|---|---|---| | without this | 12,043 | 6 | the worker thread's `int3` on the refused size | | with this | 62,596 | 50,450 | a call through a null pointer, during the pipeline creations | So this is what lets the title go on to create its pipelines on this path. The null call that ends the run is a queue method forwarded to the wrong PC method; that is my pull request for `RT-QUEUE-SIGNAL`. Tests under Wine, the four the first commit touches: | Test | Result | |---|---| | `d3d12_descriptor` | passed | | `d3d12_draw` | passed | | `gfx10_descriptors` | passed | | `d3d12_clear_formats` | failed, as it does on plain `main` under this Wine | Not built with MSVC and not run on Windows, and not run on a GPU without `VK_KHR_maintenance5`. AI-assisted (Claude Code); built and run on the machine above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:01 +01:00
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#478
No description provided.