GPU: inherit typed formats in explicit RTV and DSV descriptions #2763
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!2763
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 19:58 UTC · original
andrewpozdnakov7-jpg:fix/inherit-promoted-attachment-format→main· +164 −1 · 2 files · 1 commits · openAn 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 822d637 and 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.
@kotekompotek on GitHub · 2026-11-25 20:04 UTC · original
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.
@oni-swr on GitHub · 2026-11-25 20:16 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 23:20 UTC · original
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
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.