mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:35:53 +01:00
[PR #1204] [CLOSED] d3d12: RGBA8 render targets of a console device take UNORM and sRGB RTVs without a list (D3D-RGBA8-SRGB-UNORM-RTV) #1235
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#1235
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/1204
Author: @DadaCap
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:rgba8-srgb-unorm-rtv📝 Commits (1)
bbf7c82d3d12: RGBA8 render targets of a console device take UNORM and sRGB RTVs without a list (D3D-RGBA8-SRGB-UNORM-RTV)📊 Changes
4 files changed (+123 additions, -5 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+9 -0)📝
runtime/README.md(+2 -2)📝
runtime/shims/d3d12_vulkan_device.cpp(+15 -2)📝
runtime/test/d3d12_draw_test.cpp(+97 -1)📄 Description
Claimed in the coordination issue as: D3D-RGBA8-SRGB-UNORM-RTV
What and why
The retail title draws its Bink movie through an
R8G8B8A8_UNORMRTV of anR8G8B8A8_UNORM_SRGB2D texture made withALLOW_RENDER_TARGETand no castable list (measured on a retail boot, RTX 5080).CreateRenderTargetViewrefused the view (unsupported typeless or RGBA8 RTV format/subresource: 28), so the movie's draw had no target. The console allows the cast.CreateRenderTargetView, the clear path and the draw path already handle this cast when the texture's castable list names the view. So the only change is which list the texture gets: on a device the Xbox-ABI proxy owns (set_device_outer, whichD3D12XboxCreateDevicecalls), a 2DR8G8B8A8_UNORMor_SRGBrender target without a list of its own gets {UNORM, SRGB} inResource::create_texture. That covers every creation slot (27, 29, 76, 127, 133) without touching the proxy or losing the initial state, and a device without the proxy behaves as before.Limits:
B8G8R8A8and other families are left as they are: no such cast has been seen.Tested
Built with MSVC (Ninja, RelWithDebInfo).
d3d12_draw_testgained a block: for an sRGB texture with a UNORM RTV and the reverse, a clear and a draw are read back as raw bytes, and the same texture made while the device has no proxy must still refuse the RTV (Closefails). With the device change disabled the test does not get through this block; with it, it passes.Run with and without
LEONIDA_VK_VALIDATION=1, exit 0 in both and no VUID messages:d3d12_draw,d3d12_clear,d3d12_typeless_rtv,d3d12_vulkan_device,d3d12_method_variants,typeless_rtv,xs_proxy_mock,d3d12_descriptor,d3d12_present,d3d12_msaa_draw,d3d12_srgb_uav,d3d12_m2_textured,d3d12_m3_frame.d3d12_first_lightskips (exit 77).scripts/check_no_game_data.pypasses on the touched files.Not run: the rest of
ctest, another GPU, Linux/Wine, the translator suite (untouched), and the retail title with exactly this change (a local prototype with the same list and another gate showed the movie).GPUs tested: NVIDIA GeForce RTX 5080, 621.24, Windows 11 build 26200
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (not applicable: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.