mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:10:53 +01:00
[PR #592] [CLOSED] fix(d3d12): fp16 fallback for R9G9B9E5 render targets (RT-RGB9E5-HALF) #634
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#634
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/592
Author: @derkoch1337
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:rt-rgb9e5-half📝 Commits (3)
62c1950fix(d3d12): fp16 fallback for R9G9B9E5 render targets (RT-RGB9E5-HALF)07f7939fix(d3d12): convert R9G9B9E5 fp16 copies at the logical footprint (RT-RGB9E5-HALF)06cddcffix(d3d12): resolve RT-RGB9E5-HALF review holds📊 Changes
12 files changed (+1021 additions, -303 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+20 -3)📝
runtime/shims/d3d12_vulkan_device.cpp(+53 -6)📝
runtime/src/depth24.h(+4 -1)📝
runtime/src/depth24_convert.comp(+45 -1)📝
runtime/src/depth24_convert.inc(+453 -261)📝
runtime/src/queue_families.h(+7 -8)📝
runtime/src/vulkan_depth24.h(+4 -1)📝
runtime/src/vulkan_replay.h(+116 -11)📝
runtime/src/vulkan_scratch.h(+2 -1)📝
runtime/test/d3d12_clear_test.cpp(+10 -2)📝
runtime/test/d3d12_r9g9b9e5_uav_test.cpp(+302 -3)📝
runtime/test/vk_queue_test.cpp(+5 -5)📄 Description
Item: RT-RGB9E5-HALF (claimed in #14). Credits lightelectriclife's finding.
Problem
On NVIDIA,
VK_FORMAT_E5B9G9R9_UFLOAT_PACK32has noCOLOR_ATTACHMENTorSTORAGE_IMAGEsupport, so the layer refused anALLOW_RENDER_TARGETR9G9B9E5_SHAREDEXPtexture withE_INVALIDARG. The Series S retail boot creates a 1920x1080 format-67 render target withALLOW_RENDER_TARGET | ALLOW_UNORDERED_ACCESSand stops there.What changes for the user
Such a render target is now backed by an
R16G16B16A16_SFLOATimage instead of being refused. fp16 holds every shared-exponent value exactly, so the texture keeps its values (at twice the memory per texel); rendering, sampling and UAV access all work, andCheckFeatureSupportadvertisesRENDER_TARGETfor the format. The resource is GPU-owned, so no CPU layout depends on the format. UAV-only textures keep the existing mutableR32_UINTemulation unchanged, and the request is still refused where fp16 cannot back it. This is the fp16 target fallback used in ivall/xcl #242.Testing
AI-assisted. Built with VS 18 2026 (MSVC 14.51) and run on an NVIDIA GeForce RTX 5080, driver 610.88, with
LEONIDA_VK_VALIDATION=1:d3d12_r9g9b9e5_uav_test: the new render-target section creates the RT+UAV texture, clears it through the RTV and reads the fp16 texels back bit-exact; the existing UAV sections still match (6/6 WARP clears, 16/16 copies, 16/16 bindless round-trip). 0 validation errors.d3d12_b5g5r5a1_uav_test,d3d12_srgb_uav_test,d3d12_uav_clear_test: all pass, 0 validation errors.docs/d3d12_vulkan.mdrecords the fallback.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.