GPU: textures drop unordered access in formats the host cannot write (NVIDIA B5G5R5A1) #1787
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1787
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1787"
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?
@Danigamer05 on GitHub · 2026-11-24 22:33 UTC · original
Danigamer05:fix/nvidia-unordered-formats→main· +98 −0 · 1 files · 2 commits · openWhat
host_desckeeps the title's unordered-access flag for a texture whose format the host GPU cannot write from shaders. NVIDIA has no typed unordered access forB5G5R5A1_UNORM(format 86); AMD has. On an NVIDIA card the host description is then invalid, and the size query thatshared_texturemakes with it (GetResourceAllocationInfo) removes the device.host_descdropsUNORDEREDwhenhost_unordered_formatsays the host has no typed unordered access views for the format.host_unordered_formatasksCheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)once per format and logs the formats it turns down. Typeless formats keep the use, since their views decide later. Without a host it answers yes.unordered_access_only_in_formats_the_host_writes: render-target + UAV textures in formats 86, 28, 87, 2 and 10 keep their render-target use, keep UAV exactly when the host has it, and are created by the host.Why
On
main70564ae, on an RTX 2080 SUPER (driver 621.01, Windows 11), every run ended in the menus about 50 s after start withDXGI_ERROR_INVALID_CALL(0x887A0001). WithVICTORY_D3D12_DEBUG=1the debug layer names it:With this change the log shows
the host has no unordered access for this format: its textures are made without it format=86, the run passes the menus and loads into the world, where it later stops on a GPU hang. That hang is the known wave64-on-32-lane class (mainrefuses no wave64 programs on NVIDIA) and is not touched here.Tests
cargo test -p victory-gpu --lib: the new test passes. Two tests fail on this machine both with and without this change, so they are not caused by it:descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_views.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.rustfmt --check: clean for the lines this changes (other files onmainhave unrelated differences).No game data in the diff or the description. AI-assisted (Claude Code); runs on my machine with my own copy.
🤖 Generated with Claude Code
@DesertGamer on GitHub · 2026-11-24 22:34 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@upipibi on GitHub · 2026-11-24 22:35 UTC · original
Related, for the reviewers: #1763, #1775 and #1780 (one change three times) fix the other half of the same NVIDIA
B5G5R5A1_UNORMproblem. They refuse the unordered view indescriptor::host::fits, where this PR dropsUNORDEREDfrom the texture's host description inresource.rs. The two look complementary rather than duplicates: once this drops the flag, an unordered view of such a texture still has to be refused, which is whatfitsdoes in those PRs. From reading the descriptions and file lists; nothing built.AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 06:18 UTC · original · edited 2026-11-25 09:18 UTC
Automated triage for the maintainers.
Needs work. Thanks for the update (
e0e5096). The main point is fixed:host_descincrates/victory-gpu/src/resource.rsnow keepsUNORDEREDwhen the format or any format incastable(format)takes typed UAVs, soB5G5R5A1_UNORMkeeps its 16-bit alias writes on NVIDIA. That makes this more accurate than #1832, which drops the flag based on the format alone. One real problem remains in the new fallback inmake_texture:initialis computed before creation aslegal_for(d.flags, texture_state(state))with the original flags. The fallback removesUNORDEREDfromplain, but it still passes thatinitialtoCreateCommittedResource. A texture the title creates in the unordered-access state (0x8) is then created in a state its flags do not allow, and creation fails again. Recomputeinitialfromplain.flagsthere, and make the test create one texture with an unordered-access starting state (it currently passes0).shared_texture'stakesreads the host texture's actual flags, so later title textures of the same memory that ask for unordered access will replace the fallback texture again and again. Worth a note or a check./// A 4x4 texture filled from a title buffer…lines, so that text now documents the new test, andbuffer_data_reaches_the_host_textureloses its doc comment.With the initial-state fix, this looks mergeable as the resource-side complement to #1763's view refusal.
CI: passing (
check).Generated by Claude Code
@Danigamer05 on GitHub · 2026-11-25 09:08 UTC · original
Thanks for the review, both points are right. Pushed
e0e5096:host_descnow dropsUNORDEREDonly when neither the texture's format nor any format incastable(format)takes typed unordered access. ForB5G5R5A1_UNORMon NVIDIA the flag stays, sinceR16_UINT/R16_FLOATtake it, andmake_texturecreates the texture with those formats throughCreateCommittedResource3.CreateCommittedResource3is refused (or there is noID3D12Device10),make_texturefalls back toCreateCommittedResourcewith no cast list. There the alias is gone and the flag on format 86 is illegal, so the fallback now dropsUNORDEREDwhen the format alone lacks it. Before, that path just failed with "no host texture".unordered_access_only_where_the_format_or_an_alias_takes_it) creates formats 86, 28, 87, 2, 10 and 85 throughmake_textureand checks the flag against the format plus its castable list. It passes on an RTX 2080 SUPER (32..32 lanes, driver 621.01). Clippy-D warningsis clean forvictory-gpu.On the removal itself: agreed, the
GetResourceAllocationInfoline is a warning. With #1763's refusal of the unordered view of format 86, this PR is only needed for the no-castable fallback and for the flag to match what the host can do. If #1832 is the one carried forward, I'm fine closing this one.AI-assisted (Claude Code).
@latentdev on GitHub · 2026-11-25 13:42 UTC · original
RTX 4090: the device is removed by a typed UAV made in B5G5R5A1_UNORM itself
RTX 4090, driver 621.24, Windows 11, title 1.0.2.1, diag build with
VICTORY_D3D12_DRED=1, booting to the start screen. Each build ismain940d32f+ #1779 (9323a74) + #1778 (ba67548) + the PR named below + #2332 (0e350ab, the B4G4R4A4 render target). All merge without conflicts. #1630 is left out so nothing had to be resolved by hand.f1e53b8)e0e5096)DXGI_ERROR_INVALID_CALL(3 of 3 runs)host_unordered_format(27)forced false (one-line local change)With the D3D12 debug layer (
VICTORY_D3D12_DEBUG=1), the messages right before the removal on this PR are, in order:The same 75 s on #1832 has neither 599 nor 342. The only other messages in both builds are the 2^21 heap probe (645), one sampler-heap message (1419), the wave64 compute refusals and pipeline-library misses.
So keeping
ALLOW_UNORDERED_ACCESSfor the 16-bit aliases is fine at creation (CreateCommittedResource3with the castable list). Two other places still treat the texture as if B5G5R5A1 itself took typed UAVs:CreateUnorderedAccessView. Before that call, a typed UAV in a format the host cannot write needs to become null, or be made in a castable format that takes it.GetResourceAllocationInfoinHostTexture::newand inshared_texturegets the description without its castable formats, so the debug layer rejects it.ID3D12Device12::GetResourceAllocationInfo3takes the castable list.Happy to run a candidate on this card.
@KainanP on GitHub · 2026-11-25 19:36 UTC · original
RTX 4060 Laptop (610.47), merged onto main
13f91cae: B5G5R5A1 UAV half not fixed (the flag stays because castable(86) includes R16 formats that store, so the UAV in 86 still removes the device); B4G4R4A4 half also still removes it; no new failures. Details and the side-by-side table with the other #1753 PRs: #1753. Tested with the help of an AI assistant (Claude Code).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.