Repository navigation
GPU: aspect-aware concrete format resolution for typeless views (fixes #882, #876) - #970
pushkarreddyy wants to merge 1 commit into
Conversation
|
The format-table test passed at Three cases remain relevant to #882. An explicit D24_UNORM_S8_UINT request stayed at the attachment format (45). With the descriptor absent altogether, the preparation helper returned success without supplying a concrete format. An explicit stencil format (47) stayed 47, but this helper only receives the format and cannot select the stencil plane. The comparison stopped at preparation, before host view creation or shader execution. For integration, #651 already handles explicit depth/stencil aspect selection. Keeping the R16 depth and color cases distinct is also important: the same typeless family can back either usage. |
A shader or UAV view naming a typeless format (or none) of a typeless host texture was refused or created with the typeless format, which the host rejects: the slot stayed null and read black. Such views now read the family's concrete format (a depth family's readable aspect, else its main typed format). A view with no description at all is still refused. From upstream PR Marvisak#970 (60222b3), adapted. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
|
Thank you @Zipettte for verifying the test suite on AMD Radeon RX 7700 XT, and thank you @MichaelSmithAI for the hardware testing and valuable depth/stencil format notes on RTX 4090! |
|
Code review of
|
|
Put together a follow-up commit stacked directly on
Synthetic |
|
Automated triage for the maintainers. Needs rebase. This PR no longer merges cleanly into From the earlier needs-work note, still open: move Generated by Claude Code |
60222b3 to
0aab24a
Compare
0aab24a to
d782a7d
Compare
|
Updated and pushed commit
Thank you to @fuzeofficlal and @Yaekai for the detailed review feedback and hardware test findings. |
|
Hi @Marvisak — all triage feedback points ( |
|
If any testers on untested GPU models (such as NVIDIA RTX 30/40/50 series, AMD RDNA2/RDNA3/RDNA4, Intel Arc, or Linux/Wine/vkd3d-proton) can verify this build ( AI-assisted: yes (Gemini 4 Neon) |
|
I ran a guest command-list readback on
The omitted descriptor preserves the sRGB conversion. For an explicit UNKNOWN SRV, This case starts with a known typed guest texture. It gives no evidence for choosing a format when the guest itself supplied a typeless resource. I set |
Fixes #882, #876.
Root Cause
On
main,fits()incrates/victory-gpu/src/descriptor/host.rsleaves typeless view formats (_TYPELESS) untouched when creating SRVs/UAVs on_TYPELESShost textures, and refuses views without an explicit description. D3D12 rejects_TYPELESSview formats andNoneview descriptions on_TYPELESSresources, causing views to fall back to null.Implementation Details
crates/victory-gpu/src/resource.rs):is_typeless(format)withchecked_add(1)overflow protection for malformed/boundary format words (e.g.u32::MAX).concrete_view_format(format, depth, unordered) -> Option<u32>which:19..=21->21,22->22,44..=46->46,47->47,39|40->41,55->56) to legal D3D12 SRV formats rather than DSV attachment formats.R16_TYPELESS(53) byALLOW_DEPTH_STENCIL:R16_UNORM(56) for depth resources vs.R16_FLOAT(54) for non-depth color/UAV resources.90->87,88|92->88,94->95, and standardf + 1families).Nonewhenunordered == truefor formats without legal D3D12 UAV support (planar depth/stencil,D16_UNORM,B8G8R8X8, and block-compressed70..=84/94..=99).fits()Validation (crates/victory-gpu/src/descriptor/host.rs):default_srv_descanddefault_uav_descto synthesize fullD3D12_SHADER_RESOURCE_VIEW_DESC/D3D12_UNORDERED_ACCESS_VIEW_DESCstructures (dimension, mip count, array/depth extent, seeded fromview_format(resource)) when a title omitspDescon a typeless host texture.fits()to trackALLOW_DEPTH_STENCIL, returnfalseifformatremainsNoneon a typeless texture (guaranteeingNonenever reaches D3D12), and resolve view formats viaconcrete_view_format(view, depth, unordered).default_srv_descanddefault_uav_descintomake()forView::ShaderandView::Unordered.Verification
concrete_view_format_resolves_color_depth_uav_and_boundsincrates/victory-gpu/src/resource.rsverifies color, depth,R16_TYPELESSdepth vs. color/UAV, planar depth UAV rejection, BC UAV rejection, and0/u32::MAXbounds.VICTORY_D3D12_DEBUG=1).check(build, clippy-D warnings, workspace tests) passing ond782a7d.Scope & Limitations
#651) remain unchanged.