GPU: inherit typed formats in explicit RTV and DSV descriptions #2761
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2763"
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 andrewpozdnakov7-jpg on 2026-11-25T19:58:41Z.
An explicit RTV or DSV may set DXGI_FORMAT_UNKNOWN to inherit the resource format. VIctory forwarded UNKNOWN even when the guest resource was typed and its host texture was typeless. Fill in the guest format when recording the view. The requested dimension, slice, mip and depth flags are preserved. RTV specification · DSV specification
13f91ca, both regression tests encounter UNKNOWN before submission, where the attachment needs R8G8B8A8_UNORM_SRGB or D32_FLOAT.6cdae0e, the guest clear and copy return blue [0, 0, 255, 255] from the unselected slice and sRGB red [137, 0, 0, 255] from the selected slice. Both promoted and ordinary typed sRGB targets pass. The depth descriptor keeps mip 1 and READ_ONLY_DEPTH while taking D32_FLOAT.The combined tree 64cb4bf (this branch, #1406 at
822d637and its offered default-RTV test f25c81d) passed 20 resource tests and the serial WARP suite with 203 passing and one ignored under each D3D12 debug setting.Refs #1242
Coordination claim
Please retain the Git author on cherry-pick or rebase. If you fold the fix or tests into another commit, please add the following trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted with Codex. Synthetic textures on WARP.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T20:04:48Z.
Correct fix: DXGI_FORMAT_UNKNOWN must resolve to the guest's format before the view is recorded, since the host texture may be typeless (UNKNOWN would then be an invalid view). Naming 29 directly on a typeless-27 texture is legal - sRGB variants sit in the same typeless family - and preserves sRGB semantics rather than silently linearizing via 28. Test clears through both explicit and inherited views on both flag paths.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T20:16:11Z.
Independent WARP verification: PR head
6cdae0eEnvironment: Windows 11, rustc/cargo 1.98.1, debug build,
VICTORY_WARP=1 VICTORY_D3D12_WARP=1(Microsoft WARP only, no physical GPU), Windows SDK 10.0.26100.0dxil.dll1.8.2502.11 onPATH. Tested the PR head itself (single commit directly onorigin/main13f91caee2, so identical to the merge tree). All commandscargo ... --locked.Baseline on origin/main:
test -p victory-gpu --lib: 195 passed, 0 failed, 1 ignored.--features diagnostics: 1 failure,memory::tests::a_submission_that_missed_leaves_the_copies_at_once(memory.rs:886), pre-existing and flaky on main (failed 3 of 4 repeated full runs, passes alone).clippy --all-targets --features diagnostics -D warnings: clean.On this PR:
test -p victory-gpu --lib: 197 passed, 0 failed, 1 ignored (+2 new tests).test -p victory-gpu --lib --features diagnostics: 200 passed, 0 failed, 1 ignored (the flaky baseline test happened to pass in this run).clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings: clean.descriptor.rsfrom origin/main (production fix removed, tests kept):rtv_unknown_format_inherits_the_typed_resource_formatfails (host format 27= typeless, recorded format 0, expected 29), then restored the PR file.dsv_unknown_format_...is coverage only (no production change for DSV), so it has no negative control.Review:
create_rtvnow resolvesDXGI_FORMAT_UNKNOWNin an explicit description to the guest resource's format, only when a description was passed and the format word is 0. Behaviour for null descriptions is unchanged. I found no correctness problems. The test covers typeless (UAV-promoted) and non-promoted hosts and checks the cleared texels per array slice. Minor: iftitle_formatreturnsNone(null resource) it falls back to 0, same as before.Not tested: a physical GPU, any retail title or game behavior, a release build, non-Windows targets.
AI disclosure: this verification was run by Claude Code (Claude Sonnet 5.5). No game files, dumps, shader names or retail hashes were used.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:20:10Z.
Automated triage for the maintainers.
In
crates/victory-gpu/src/descriptor.rs(create_rtv, whichcreate_dsvalso goes through), an explicit view description withDXGI_FORMAT_UNKNOWNnow gets the guest resource's format recorded, soRtvRecord::host_descno longer hands UNKNOWN to the host when the host texture was made typeless (sRGB with unordered access, shader-read depth). This follows the documented D3D12 rule that UNKNOWN means the resource's format; I checked that nothing else reads the recorded format word as UNKNOWN, that null descriptions are unchanged, and that it complements rather than overlaps #1406 (null descriptions). The two tests inresource.rscover the promoted and plain sRGB cases and the depth view's mip/flags. CI (check) passes.This is a recommendation for a maintainer to look, not an approval.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:30:38Z.
Review: COMMENTED
Verified head
6cdae0eccleanly merged ontoorigin/main(63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP +VICTORY_D3D12_DEBUG=1).Code Review
DXGI_FORMAT_UNKNOWN(words[0] == 0) increate_rtv(shared withcreate_dsv) viacrate::resource::title_format(resource)cleanly inherits the guest typed format while preservingdimension, array/mip slices, and DSV flags, lettingRtvRecord::host_desc()map throughpc_formatcleanly even when the host backing resource is typeless (sRGB or depth).Local Verification (
VICTORY_D3D12_DEBUG=1)--features diagnostics):descriptor::tests+draw::tests+resource::tests: 47/47 passed on both adapters (includingrtv_unknown_format_inherits_the_typed_resource_formatanddsv_unknown_format_inherits_depth_and_keeps_its_subresource).victory-gpu --features diagnostics --lib): 248/248 passed (1 ignored).cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics) &cargo xtask policy(191 files ok): clean.Looks clean and ready to merge.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T04:10:01Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090):cargo test -p victory-gpu --lib resource::tests: 20 passed, 0 failed (including newrtv_unknown_format_inherits_the_typed_resource_formatanddsv_unknown_format_inherits_depth_and_keeps_its_subresource).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.