VIctory — code review: DXGI typeless SRV remapping needs an aspect-aware path #882
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#882
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@ffhasoon76-del on GitHub · 2026-11-24 13:23 UTC · original
VIctory — code review: DXGI typeless SRV remapping needs an aspect-aware path
Target discussion: #876
Reviewed patch: https://github.com/Xvania7/VIctory/tree/fix/issue-850-typeless-view (commit
5e3c9e2as reported in issue #876)Review type: static source / public DXGI specification review only. No game binary, assets, hardware runtime, or integration test was used.
Finding
The patch adds
first_concrete(format)tocrates/victory-gpu/src/resource.rs, with three explicit cases (90→87, 92→88, 39→41) and a fallback for typeless formats:f + 1.adapt_view_format()calls that helper when the host resource and requested view are both typeless (or the explicit view uses UNKNOWN).This helps the demonstrated color case,
DXGI_FORMAT_R8G8B8A8_TYPELESS(27) →R8G8B8A8_UNORM(28). However, the numeric-first-member rule is not valid for all DXGI format families:R32G8X24_TYPELESS(19)D32_FLOAT_S8X24_UINTR32_FLOAT_X8X24_TYPELESS(depth) or 22 =X32_TYPELESS_G8X24_UINT(stencil).R24G8_TYPELESS(44)D24_UNORM_S8_UINTR24_UNORM_X8_TYPELESS(depth) or 47 =X24_TYPELESS_G8_UINT(stencil).R16_TYPELESS(53)R16_FLOATR16_UNORMfor D16_UNORM depth;R16_FLOATis correct only if the resource was intended to hold floating-point data.Suggested action
first_concrete()as a universally valid SRV decision.f + 1.D16_UNORMvsR16_FLOATreinterpretation.Suggested minimal guardrail test
A unit test for the future aspect-aware view-resolution helper should assert outputs from a request that carries intended use, rather than asserting that every typeless format maps deterministically:
Important limitation: This is a code-review edge case, not a verified root cause of the missing rendered image. Actual impact depends on whether these formats occur in the game's view requests and how those requests encode plane intent.
References
@MichaelSmithAI on GitHub · 2026-11-24 13:33 UTC · original
Melissa checked the R16 distinction with two textures in the same compute dispatch on RTX 4090 under Wine/vkd3d-proton 3.2. A D16 depth texture cleared to 0.25 read back within one 16-bit UNORM step. A color R16_TYPELESS resource cleared through R16_FLOAT to 0.75 read back exactly 0.75 through its explicit FLOAT SRV. The same build passed #651’s descriptor-selection checks for the explicit depth and stencil views in families 19 and 44. Those two families were checked at descriptor preparation.
We also checked the explicit UNKNOWN RGBA8 SRV that fuzeofficlal identified. In the updated focused comparison (d67dcde), both an explicit UNKNOWN and an explicit RGBA8_TYPELESS SRV on RGBA8_TYPELESS backing read the expected color after a UAV clear. The UNKNOWN case uses the supplied SRV description’s dimension and mip range. This complements fuzeofficlal’s native RTX 5090/WARP A/B and their existing f25e9d5 fix. The game’s failing frame still lacks an identified binding. Focused branch and tests · Native comparison
@fuzeofficlal on GitHub · 2026-11-24 13:37 UTC · original
I tested the existing #651 plane selector on top of
b7a0a8c, the current #876 head. The integration runs plane selection before the typeless fallback, so the final check sees both the readable format and the matchingPlaneSlice. The existing #651 test now also runs its 20 descriptors through that final check. Integration commitA source-built compute shader read synthetic D32S8 and D24S8 textures, cleared to depth
0.25and stencil0x5a. RTX 5090 and software WARP both produced the same depth and stencil results.UNKNOWN0.250000000.250000000x5a0.250000030.250000030x5aThe guest stencil description used plane 0 and #651 selected host plane 1. In the same dispatch, the RGBA8
UNKNOWNview matched the explicit UNORM control at0.50196081. Explicit sRGB stayed near0.216.The GPU library passed 55 default and 58 diagnostics tests, with one ignored in each. Coverage is the synthetic Texture2D SRV path.
@LAKSHYA-cmd-tech on GitHub · 2026-11-24 13:50 UTC · original
Implemented and verified in downstream PR #25: mapped 19 -> 21 (R32_FLOAT_X8X24_TYPELESS) and 44 -> 46 (R24_UNORM_X8_TYPELESS), bypassing the DSV-only formats (20, 45) to prevent E_INVALIDARG when creating depth-stencil SRVs.
@pushkarreddyy on GitHub · 2026-11-24 14:13 UTC · original · edited 2026-11-24 14:21 UTC
Thanks @LAKSHYA-cmd-tech for verifying downstream in PR #25!
Our standalone branch fix/gpu-typeless-srv-aspect-aware (commit 60222b3) is fully formatted and tested with unit tests covering depth (19, 44, 39, 53) and color (27, 90, 92, 94) families, ready for direct merge by @Marvisak whenever convenient.
@pushkarreddyy on GitHub · 2026-11-24 13:36 UTC · original · edited 2026-11-24 14:22 UTC
Verified Aspect-Aware SRV Resolution Ready on Fork
The implementation resolving aspect-aware concrete format selection for typeless views is complete and pushed to my fork:
ffe310e)Compare: https://github.com/Marvisak/VIctory/compare/main...pushkarreddyy:VIctory:fix/gpu-typeless-srv-aspect-aware
Implementation Details
@pushkarreddyy on GitHub · 2026-11-24 13:34 UTC · original · edited 2026-11-24 14:22 UTC
Claiming this issue.
Technical Analysis & Solution Architecture
In crates/victory-gpu/src/resource.rs and crates/victory-gpu/src/descriptor/host.rs:
On console, titles create SRVs using typeless formats or default (0) formats directly on typeless resources. On PC D3D12, ID3D12Device::CreateShaderResourceView requires a concrete, typed format and returns E_INVALIDARG if given a _TYPELESS or DSV format.
As correctly identified in this issue review, a naive f + 1 fallback erroneously assigns DSV formats to depth resources:
Implementation Plan
esource.rs and descriptor/host.rs covering all depth and color families.
Preparing clean branch with Rust 2024 compliance on fork.
@pushkarreddyy on GitHub · 2026-11-24 14:37 UTC · original
Pull request is now open for review: #970.
@Marvisak on GitHub · 2026-11-25 06:56 UTC · original
Automated triage for the maintainers.
This reviews the branch offered in #876.
mainhas nofirst_concreteand no typeless-to-concrete view mapping incrates/victory-gpu/src/resource.rs, so the finding applies to that branch, not tomain. The point holds for what it describes:f + 1picks the DSV formats 20 and 45 for families 19 and 44, andR16_FLOATfor 53. An aspect-aware version is open as PR #970 (fix/gpu-typeless-srv-aspect-aware, which names this issue and #876), so review continues there. The cutscene cause is discussed in #850.Left for the maintainers.
Generated by Claude Code