GPU: fix NULL/UNKNOWN SRV/UAVs on promoted-typeless textures and MSAA/array/3D NULL RTV/DSVs #1405
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by ESAT586 on 2026-11-24T17:47:10Z.
Summary
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 okImported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T17:57:00Z.
Review: APPROVED
Tested merged cleanly onto
main(ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC) with NVIDIA GeForce RTX 5090 (Blackwell) and WARP (VICTORY_D3D12_WARP=1):cargo test -p victory-gpu(RTX 5090): 52 passed, 0 failed, 1 ignoredVICTORY_D3D12_WARP=1 cargo test -p victory-gpu(WARP): 52 passed, 0 failed, 1 ignoredcargo clippy -p victory-gpu --all-targets: 0 warningscargo xtask policy: okClean fix for NULL/UNKNOWN SRV/UAVs on promoted-typeless textures and MSAA/array/3D NULL RTV/DSVs, verified on Blackwell hardware and WARP. Approving.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T18:03:41Z.
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.
Imported from Marvisak/VIctory. Originally posted by AnoHunted on 2026-11-24T18:38:13Z.
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).Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:49:55Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; this is source review of a large diff plus the PR's own Windows tests.
NULL/UNKNOWN SRV/UAV/RTV/DSV descs on promoted-typeless textures and MSAA/array resources: explicit_desc translates the format to PC when described, otherwise default_rtv_desc/default_dsv_desc/default_srv_desc/default_uav_desc build host-layout descs from the resource desc (dimension, array size, sample count), depth_srv_format and promoted_view_format handle the typeless promotion. Tests pin null RTV/DSV descs vs resource dimension+MSAA and promoted typeless acceptance. Careful desc-building; Windows-only.
Imported from Marvisak/VIctory. Originally posted by wbkepler on 2026-11-24T20:56:12Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:26:04Z.
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
Imported from Marvisak/VIctory. Originally posted by ESAT586 on 2026-11-25T13:12:06Z.
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.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T19:44:43Z.
I ran the same WARP clear-and-readback fixture on main
13f91caand on this PR at822d63788f. 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.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T19:54:08Z.
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).Imported from Marvisak/VIctory. Originally posted by ESAT586 on 2026-11-25T20:27:07Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.