Repository navigation
Runtime: B5G6R5 render targets and packed readback (D3D-61) - #587
Conversation
D3D12 stores blue in the low five bits of B5G6R5. Use the Vulkan packed format with the same ordering and check the two-byte words returned by full-image and rectangular clears.
|
I also checked a sampled SRV independently of the RTV clears on The Windows runtime CI job passed. Three checks failed with the same inputs and output as their base runs on |
# Conflicts: # runtime/shims/d3d12_vulkan_device.cpp
|
Merged Eight of nine CI jobs passed, including Windows runtime and both semantic suites. The only failing job, llvmpipe, returns the same words for |
# Conflicts: # runtime/test/d3d12_vulkan_device_test.cpp
|
Tested 6e0d206 on NVIDIA GeForce RTX 3060, driver 617.14, Windows 11: pass Setup: Windows 11 Pro 24H2 (10.0.26100), RTX 3060 (Ampere), NVIDIA 617.14, MSVC 14.44.35207 + Windows SDK 10.0.26100, Ninja RelWithDebInfo, Khronos Vulkan-Headers 1.4.369, VK_LAYER_KHRONOS_validation 1.4.357. PR head built as-is (not rebased; it conflicts with main c432cdc now). Build: 0 errors, 0 warnings. ctest: 24/24, also with LEONIDA_VK_VALIDATION=1. AI-assisted: the build and test runs were done with an AI coding assistant (Claude Code) on my machine; the numbers above are its unedited output. |
|
Tested fc7e0a1 merged onto main c432cdc on NVIDIA GeForce RTX 4060 Ti (Ada), driver 32.0.16.2124 (NVIDIA 621.24), Windows 11 Home 26300, MSVC 2022 / Ninja, Vulkan SDK 1.4.363: pass. Besides ctest, I ran each test program this PR changes directly (several aren't registered with ctest):
ctest: 100% tests passed, 0 tests failed out of 27. AI-assisted. |
|
Tested fc7e0a1 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass
No game files used. AI-assisted run (Claude Code). |
The only conflict: block_format's two-byte list, where main added R5G6B5_UNORM_PACK16 (ProjectLeonida#587) next to this PR's A4R4G4B4_UNORM_PACK16. Both kept.
…n now has ItsNotRexed#562/ItsNotRexed#587 landed the same R9G9B9E5_SHAREDEXP and B5G6R5_UNORM mappings this branch adds. The textual merge was clean but left duplicate case labels (MSVC C2196) in texture_format and the block-size table; keep one of each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed in the coordination issue as D3D-61, B5G6R5_UNORM.
What and why
The runtime rejects a B5G6R5 render target at resource creation. D3D12 requires render-target support for this format at feature level 12.1. Use
VK_FORMAT_R5G6B5_UNORM_PACK16because its low five bits store blue, and account for two bytes per texel in D3D12 footprints and Vulkan buffer-image copies. Microsoft format supportTested
Windows 11, RTX 5080, driver 616.92, Vulkan validation enabled. On the unmodified base
ee97b84, the added case exited 1 atCreateCommittedResource.d3d12_vulkan_device_testused the runtime Xbox-ABI device proxy, RTV heap, D3D12 graphics command list and queue. A full 8×8 clear to (1, 0.25, 0, 1) followed by a 4×4 rectangle clear to (0, 0.75, 1, 0) produced 48 words of0xfa00outside and 16 of0x05ffinside. All 64 matched afterCopyTextureRegionand fence completion. A local control swapping the clear colors' red and blue channels failed on the first word,0x021finstead of0xfa00.ctest --test-dir build-review/runtime --no-tests=error -R "^gfx10_descriptors$" --output-on-failurepassed.AI-assisted with OpenAI Codex.
Checklist
docs/design.md, with how it was confirmed. (N/A, runtime format mapping.)