GPU: fix NULL/UNKNOWN SRV/UAVs on promoted-typeless textures and MSAA/array/3D NULL RTV/DSVs #1406
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!1406
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1406"
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?
@ESAT586 on GitHub · 2026-11-24 17:47 UTC · original
ESAT586:gpu/typeless-null-views→main· +550 −38 · 2 files · 1 commits · openSummary
Fixes two descriptor bugs on promoted-typeless host textures tracked in #1242 (
VIC-BT-004P0 andVIC-BT-012P1):NULL-desc and
DXGI_FORMAT_UNKNOWNSRV/UAVs on promoted-typeless textures (crates/victory-gpu/src/descriptor/host.rs—VIC-BT-004):host_texture()promotes typed sRGB textures withALLOW_UNORDERED_ACCESSand shader-readable depth textures (D32_FLOAT,D24_UNORM_S8_UINT,D16_UNORM,D32_FLOAT_S8X24_UINT) toTYPELESSformats on the host.fits()rejecteddesc == Noneordesc.Format == DXGI_FORMAT_UNKNOWN (0)whenever the host resource was typeless, causing valid console views on typed textures to silently fall back to null descriptors.crate::resource::view_format(resource)(depth plane 0 shader format for depth SRVs, linear twin for sRGB UAVs, title format for sRGB SRVs) and synthesizes a dimension-matched default SRV/UAV descriptor whendescisNone. Natively typeless console textures (view_format == None) continue to rejectUNKNOWN/null views as required by D3D12.NULL-desc RTV/DSV dimensions for MSAA, arrays, 3D, and 1D targets (
crates/victory-gpu/src/descriptor.rs—VIC-BT-012):RtvRecord::desc()andRtvRecord::depth_desc()previously hardcodedTEXTURE_2Dwheneverself.described == 0on a promoted-typeless host texture.Dimension,DepthOrArraySize, andSampleDesc.Countto build the exact1D,1DArray,2D,2DArray,2DMS,2DMSArray, or3Dview descriptor.Verification
Tested locally on Windows 11 with NVIDIA GeForce RTX 3060 Ti (
Driver 32.0.16.1656), Rust1.98.1MSVC:cargo clippy --workspace --all-targets --locked -- -D warnings— 0 warningscargo clippy --workspace --all-targets --all-features --locked -- -D warnings— 0 warningscargo test -p victory-gpu --all-features --locked— 55 passed, 0 failed, 1 ignored (includingpromoted_typeless_textures_accept_null_and_unknown_format_viewson real D3D12 hardware andnull_rtv_and_dsv_descs_match_resource_dimension_and_msaa)cargo xtask policy— 154 files ok@geiyiliyabumo on GitHub · 2026-11-24 18:03 UTC · original
Independent verification of \
87b42ec\ on Windows 11 / AMD Radeon RX 9060 XT (RDNA4, \gfx1200) / Rust 1.98.1 MSVC:Code audit looks clean: \default_rtv_desc\ and \default_dsv_desc\ accurately derive 1D/1DArray/3D/2DMS/2DMSArray/2DArray/2D view dimensions from the host texture's \D3D12_RESOURCE_DESC\ instead of hardcoding \TEXTURE2D.
AI-assisted; synthetic tests only, no game files.
@AnoHunted on GitHub · 2026-11-24 18:38 UTC · original
Independent NVIDIA run. No game files were used.
Machine: Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1.
cargo test -p victory-gpu -- --test-threads=1with this PR:null_rtv_and_dsv_descs_match_resource_dimension_and_msaaand the promoted-typeless null/UNKNOWN SRV/UAV tests.Scope: this is the
victory-gpuunit suite (descriptor construction logic). Not tested: the in-game effect; AMD (already reported on an RX 9060 XT).@wbkepler on GitHub · 2026-11-24 20:56 UTC · original
Interaction note: this overlaps #1353 (VIC-BT-004 part). A concrete comparison, so one can be picked:
UNKNOWNSRV/UAV on promoted-typeless textures). The two do the same thing: depth plane formats for SRVs (20→21, 40→41, 45→46, 55→56), sRGB→linear for UAVs, a desc built from the host resource when it is null, and only the format patched whenFormat == UNKNOWN. The only difference is that #1353 returnsNonefor a default UAV on an MSAA texture, while this PR builds aTEXTURE2DUAV for it. That case can't happen here, becausehost_textureonly promotes sRGB when the UAV flag is set and strips UAV from depth, so it doesn't matter in practice.WSize = -1for 3D, MSAA →2DMS/2DMSARRAY). They match. Typed host copies still get a null desc, the same as before.default_srv_desc,default_uav_descand adepth_srv_formatand change the same twomake()hunks indescriptor/host.rs, so they can't both merge as-is.This PR is the more complete fix for VIC-BT-004. If it lands, #1353 should drop its BT-004 hunk.
AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090.
@Marvisak on GitHub · 2026-11-25 01:26 UTC · original · edited 2026-11-26 00:25 UTC
Automated triage for the maintainers.
Merge candidate. The new head is one squashed commit rebased onto recent
main. Read in full, it does what the earlier head did.In
crates/victory-gpu/src/descriptor/host.rs,default_viewis replaced bypromoted_view_format. For a null description,makebuilds a default SRV or UAV description from the host texture's dimension, array size and sample count. It uses the depth plane-0 format for depth SRVs and the linear twin for sRGB UAVs, and anUNKNOWNformat is patched the same way.fitsstill runs afterwards, so incompatible formats are still refused.In
crates/victory-gpu/src/descriptor.rs,RtvRecord::desc/depth_descbuild their defaults (1D, 1D array, 2D, 2D array, 2DMS, 2DMS array, 3D withWSize = -1) from the host resource instead of always usingTEXTURE2D. These match D3D12's documented null-description defaults.It merges cleanly with current
main. andrewpozdnakov7-jpg's WARP clear-and-readback check (both mip-0 slices of a promoted two-slice target are cleared) supports the RTV part. That optional test commit is not in the PR, and it would be a good addition.CI: passing (
check).Generated by Claude Code
@ESAT586 on GitHub · 2026-11-25 13:12 UTC · original
Rebased onto \main\ (\
940d32f) at $sha\ (preserving \ yped_store, \make_view, and ©.castable\ in \its). Verified on RTX 3060 Ti and WARP: all \descriptor::\ tests (including \promoted_typeless_textures_accept_null_and_unknown_format_views\ andull_rtv_and_dsv_descs_match_resource_dimension_and_msaa) passed, strict Clippy (--all-targets\ and --all-features) clean, \cargo xtask policy\ ok.
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 19:44 UTC · original
I ran the same WARP clear-and-readback fixture on main
13f91caand on this PR at 822d63788fe3e015955343658aac7224c59de622. The fixture initializes both mips of a two-slice sRGB render target to blue, submits a red clear through VIctory with a null RTV description, then copies all four subresources to guest-visible buffers. A default RTV should cover the first mip of every array slice. D3D12 CreateRenderTargetViewThe unpromoted sRGB control passes on both heads. When the host array is promoted to typeless for UAV access, main leaves the second slice's mip 0 blue
[0, 0, 255, 255]. This PR makes both mip-0 slices red[255, 0, 0, 255]and leaves both mip-1 slices blue. Six paired WARP runs reproduced the result across both debug settings. With the test, the serial GPU suite passed 201 tests with one ignored in each setting. Strict Clippy in both feature configurations and asset policy passed.The test-only commit f25c81d is directly on your current HEAD if you'd like to include it. Please retain the Git author on cherry-pick or rebase. If you fold the test into another commit, please add the following trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted with Codex. Synthetic textures on WARP.
@fuzeofficlal on GitHub · 2026-11-25 19:54 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and code review of
822d6378(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo xtask policy: 184 files ok;cargo clippy --locked -p victory-gpu --all-targets(default &--features diagnostics): 0 warnings.VICTORY_D3D12_WARP=1,--features diagnostics --test-threads=1): 200 passed, 0 failed, 1 ignored.descriptor::tests6 passed (includingnull_rtv_and_dsv_descs_match_resource_dimension_and_msaa),promoted_typeless_textures_accept_null_and_unknown_format_views1 passed (GetDeviceRemovedReason().is_ok()),draw::tests11 passed.git merge-treewith #450, #2101, and #2679.Review Notes
promoted_view_formatcleanly usesresource::view_formatso native typeless textures keep existing D3D12 null/unknown rejection while promoted depth/sRGB textures synthesize valid default SRV/UAV descriptors, anddefault_rtv_desc/default_dsv_deschandle1D/1DArray/2D/2DArray/2DMS/2DMSArray/3Daccurately.B8G8R8X8_TYPELESStexture gets a NULL/UNKNOWN UAV rewritten93 -> 88(B8G8R8X8_UNORM), #2462 / #2679's same-familytyped_storecheck infits()cleanly rejects88as a null slot on hosts withoutB8G8R8X8_UNORMtyped UAV support (zero conflict with both).@ESAT586 on GitHub · 2026-11-25 20:27 UTC · original
Thanks so much for the independent WARP and RTX 5090 verification, @andrewpozdnakov7-jpg and @fuzeofficlal! Great to see the two-slice promoted sRGB clear regression confirmed end-to-end on WARP and RTX 5090 with zero conflicts against #450, #2101, and #2679.
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.