GPU: a 4444 render target gets a BGRA8 stand-in #3877
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3877"
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?
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-30T08:32:39Z.
For #1952 (see also #2723 for the same NVIDIA run's earlier blocker).
NVIDIA has no renderable
DXGI_FORMAT_B4G4R4A4_UNORM(console format 115) at all:CheckFeatureSupportreports noRENDER_TARGET(on the GTX 1050 not evenTEXTURE2D), soCreateCommittedResourcefailsE_INVALIDARG. The issue's 2560x1440 4444 target then has no host texture (no host texture ... format 115 flags 1), and the device is removed soon after.A texture whose format the host cannot give the description's uses (render target, unordered access, or even a plain sampled texture) is now made in
B8G8R8A8instead: same channel order, and every 4-bit value is exact in 8 bits (n*17). Views (RTV/DSV/SRV/UAV, described or default), pipelineRTVFormats, resolves and clear values all name the host texture's real format; copies between title memory and the texture expand packed 4444 rows to the host's texels and pack them back down on read backs and detiled uploads. Stand-in clears quantize to 4444 first, so a channel reads back as the console's exact nibble. Footprint/texture element mismatches that are not this stand-in are refused with a one-time warning instead of copying garbage.Testing
GTX 1050 4GB, driver 32.0.15.8228, Windows 10 19045, debug build of this branch.
cargo test -p victory-gpu --lib: 231 passed, 5 failed — the same 5 that fail onmainon this machine (descriptor heap size, placed texture, compute pipeline, dynamic slots, depth-bounds pipeline); all driver limits this PR does not touch.a_4444_copy_round_trips_through_the_stand_inanda_4444_render_target_clears_and_reads_backcreate real 4444 render targets and expand, clear and pack on the live device, reading back exact nibble patterns;a_4444_host_desc_follows_host_supportanda_4444_stands_in_where_the_host_cannot_use_itcover the capability gate without needing the host to lack the format.cargo clippy --workspace --all-targets --all-features --locked -- -D warningsclean.On this machine
creation_format(115, ...)resolves toB8G8R8A8, so the new tests exercise the stand-in for real; on a host with a renderable 4444 they take the native path instead.AI-assisted. No game data is included.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.