GPU: strip unsupported UAV/RT format flags and skip redundant pipeline library write #2180
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!2180
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2180/head"
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?
@n-romanovich on GitHub · 2026-11-25 07:06 UTC · original
n-romanovich:pr/format-support-and-library-save→main· +152 −19 · 4 files · 1 commits · closed without mergingSummary
resource.rs(host_desc): QueryD3D12_FEATURE_FORMAT_SUPPORT(format_support1) and strip or widenALLOW_UNORDERED_ACCESS/ALLOW_RENDER_TARGETwhen a format (such asB5G5R5A1_UNORMorB4G4R4A4_UNORM) cannot support or cast to a format supporting those flags, preventing D3D12GetResourceAllocationInfo/CreateCommittedResourcefailures. Adds unit testhost_desc_strips_unsupported_uav_and_rt_flags.pipeline/library.rs(save): Whenl.added == 0 && !l.prebuilt_changedand onlyearly-pipelines.txtchanged, skip re-serializing and rewriting the 1+ GiBhost-pipelines.binblob.Verification
Tested on NVIDIA GeForce RTX 5060 Ti:
cargo test --release -p victory-gpu --lib -- resource::tests pipeline::library:19 passed; 0 failed@MamaLeVrai on GitHub · 2026-11-25 08:52 UTC · original
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present, so the hardware-only shader checks run. I merged this PR's head
e1bf6701intomain940d32fin a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warnings: clean; the same with--all-features: clean.cargo test --workspace --locked: 702 passed, 0 failed, 10 ignored, two runs (mainalone on the same machine: 701 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
@Marvisak on GitHub · 2026-11-25 13:28 UTC · original · edited 2026-11-25 14:51 UTC
Automated triage for the maintainers.
Merge candidate. The PR now holds only the format-support change.
host_desc(crates/victory-gpu/src/resource.rs) queries the host'sSupport1bits through the shared cache,descriptor::host::format_support1.typed_storenow wraps that cache, so there is no second cache. For a texture asking for UAV or render-target use in a format the host can't serve, it switches to the typeless family when a sibling format supports that use, and otherwise drops the flag with a warning. Onmainsuch a texture is not created at all, so the title gets no texture. Here it gets one it can sample. Later UAVs are still refused byfits. Later RTVs are now skipped with a warning inState::set_targets(draw.rs) andclear_rtv(list.rs), the same wayset_targetsalready skips a target with no host texture. The author gives the title's log line for the case (a 2560x1440B4G4R4A4_UNORMrender target refused with0x80070057). CI (check) passes, and it merges cleanly.For the maintainer:
set_targetsalready does.Reply to @n-romanovich: thanks, all three points are addressed (the split, the reused cache, the logged handling of later views), plus the title evidence.
Generated by Claude Code
@n-romanovich on GitHub · 2026-11-25 13:57 UTC · original
@Marvisak, updated
pr/format-support-and-library-save(a4abd07) to address all triage points:pipeline/library.rssave()optimization (with theUSED_CHANGEDswap moved afterSerializesucceeds) to a separate branchperf/skip-redundant-library-save. This PR now contains only the format-support /host_descchange.CheckFeatureSupportcache: extendeddescriptor::host::typed_storeintopub(crate) fn format_support1(format: u32) -> Option<u32>soresource.rsreuses the single cache instead of adding a second one.host_desclogs (tracing::warn!) when strippingALLOW_UNORDERED_ACCESSorALLOW_RENDER_TARGET.descriptor::host::fits.draw.rs(OMSetRenderTargets) andlist.rs(ClearRenderTargetView) now checkresource::allows_render_target(texture)and warn + skip instead of callingCreateRenderTargetViewon a non-RT host texture.B4G4R4A4_UNORM(format: 115) textures withALLOW_RENDER_TARGET(flags: 1), which previously failed on the host with0x80070057:WARN victory_gpu::resource: no host texture error=... (0x80070057) desc=ResourceDesc { dimension: 3, alignment: 0, width: 2560, height: 1440, depth_or_array_size: 1, mip_levels: 1, format: 115, sample_count: 1, sample_quality: 0, layout: 0, flags: 1 }@Slay326 on GitHub · 2026-11-25 14:13 UTC · original
Measured on an RTX 3070 with a 3,843 MB library (27,160 pipelines): read whole it is one 3,665 MB private allocation for the run, and
saverewrote all of it six times in 130 s withmade=0(only the early list had changed), each time with a second copy in memory: process commit swung between 37.6 and 42.1 GB. With both PRs merged, process commit at start is 10.3 GB instead of 15.6 GB, and no save rewrites the library in a 480 s run.AI-assisted.
@KainanP on GitHub · 2026-11-25 19:36 UTC · original
RTX 4060 Laptop (610.47): merges cleanly onto main
13f91caebut does not build (allows_render_target(texture)at draw.rs:421 and list.rs:1016 needs&texture). With that fix: B5G5R5A1 UAV half fixed (flag dropped), B4G4R4A4 half no longer crashes but the target loses its render-target use, so its draws and clears are skipped; 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).@Marvisak on GitHub · 2026-11-25 22:06 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing because it does not build on
mainand its rule is stricter than the host.host_resourcereturns an ownedID3D12Resourcenow, soallows_render_target(texture)fails to compile indraw.rsandlist.rs. The format-support query ignores the castable-format lists thatmake_texturepasses, so on an RX 6700 XT and on WARP this strips flags from texturesmaincreates fine (B8G8R8X8 with unordered access, formats 68, 69 and 89 with either flag). The skip messages also warn on every call rather than once. The problem in #1600 is real; dropping a use only after the host has refused the creation, inmake_texture's last fallback, would fix it without those side effects.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed