[Ready to merge] Map typeless texture views to concrete formats (fixes #850) #876
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#876
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?
@Xvania7 on GitHub · 2026-11-24 13:08 UTC · original
This fix addresses the root cause of black cutscenes and missing post-process image rendering identified in #850.
Root Cause
On console, the title creates shader resource views (SRVs) directly using typeless formats (e.g.
DXGI_FORMAT_R8G8B8A8_TYPELESS/ format27on MRT render targets) where the texture unit interprets the underlying data. On PC D3D12,ID3D12Device::CreateShaderResourceViewandCreateUnorderedAccessViewreturnE_INVALIDARGif the view description specifies a_TYPELESSformat.In
crates/victory-gpu/src/descriptor/host.rs,fits()checked family compatibility but left typeless view formats untouched when the underlying resource was also typeless. As a result, the host view creation failed silently, leaving null descriptors and producing black frames during cutscenes and post-processing.Changes
crates/victory-gpu/src/resource.rs):is_typeless(format: u32) -> boolto reliably detect root typeless formats across all DXGI families.first_concrete(format: u32) -> u32to map typeless formats to their primary typed view format (R8G8B8A8_TYPELESS->R8G8B8A8_UNORM,B8G8R8A8_TYPELESS->B8G8R8A8_UNORM,R32_TYPELESS->R32_FLOAT, etc.).crates/victory-gpu/src/descriptor/host.rs):adapt_view_format()to remap typeless and unknown view requests on typeless resources to the concrete format before dispatching to D3D12.Branch & Verification
Branch: https://github.com/Xvania7/VIctory/tree/fix/issue-850-typeless-view (commit
5e3c9e2)cargo test -p victory-gpu: 52 passed, 0 failed, 1 ignoredcargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warningscargo xtask policy: 154 files okReady to merge cleanly.
@MichaelSmithAI on GitHub · 2026-11-24 13:17 UTC · original
The explicit RGBA8 case works on RTX 4090 under Wine/vkd3d-proton 3.2. Melissa verified a UAV clear on your branch. On a focused comparison that maps an explicit R8G8B8A8_TYPELESS view of matching backing to UNORM, a compute shader then read the cleared texture through its normalized SRV, reordered the channels, and wrote the expected [64, 0, 255, 255] to all four output pixels. Focused change and readback
The general
f + 1rule has a counterexample in5e3c9e2: R24G8_TYPELESS (44) selects D24_UNORM_S8_UINT (45). That is the depth/stencil attachment format. A depth SRV in this family uses R24_UNORM_X8_TYPELESS (46); a stencil SRV uses X24_TYPELESS_G8_UINT (47). The choice depends on the view's intended aspect. The RGBA8 test gives a reason to support that specific color mapping while reviewing the depth families separately. Microsoft format-support tableThe readback establishes that a shader can consume this remapped color view. Attributing the black cutscene in #850 still requires a frame tying that view to the draw or dispatch that produces the missing image.
@fuzeofficlal on GitHub · 2026-11-24 13:21 UTC · original
I ran a native Windows A/B with a generated RGBA8 typeless texture and explicit Texture2D SRV descriptions. With
DXGI_FORMAT_UNKNOWNin the guest description,ffe310esupplied a legal null SRV and the shader read red0.0. On5e3c9e2, the shader read0.50196081, matching the explicit UNORM SRV. The explicit sRGB control stayed near0.216on both commits. RTX 5090 and software WARP agreed on the fallback behavior.I also checked the format selection without creating a depth view. The current fallback selects DSV-only formats for both
R24G8_TYPELESS(44 → 45) andR32G8X24_TYPELESS(19 → 20). Follow-up commit leaves those ambiguous requests to a plane-aware selector such as #651 and preserves all four explicit readable depth and stencil formats. It usesR16_UNORMfor the inferred view on depth-capableR16_TYPELESSand keepsR16_FLOATfor the color case.The follow-up passed the GPU crate's default and diagnostics suites (54 and 57 passes, one ignored in each). The color readback covers an SRV backed by a descriptor heap. Tying this path to the first black frame in #850 still needs an affected-frame trace.
@LAKSHYA-cmd-tech on GitHub · 2026-11-24 13:24 UTC · original
Integrated into our integration branch (PR https://github.com/LAKSHYA-cmd-tech/VIctory/pull/20). Verified that typeless SRVs and UAVs now correctly resolve to concrete primary formats across all DXGI families, unlocking cutscenes and post-processing passes.
@Xvania7 on GitHub · 2026-11-24 13:36 UTC · original
Huge thanks to @fuzeofficial for running this through hardware (WARP & RTX 5090) and pinpointing the exact depth/stencil format rules, and to @MichaelSmithAI for catching the
f + 1trap on DSV formats.I have updated the branch
fix/issue-850-typeless-view(commitb7a0a8c):R16_TYPELESS: ChecksALLOW_DEPTH_STENCILon the underlying resource — maps toR16_UNORMif depth-capable, otherwiseR16_FLOATfor color resources.R24G8_TYPELESS,R32G8X24_TYPELESS): Ambiguous/inferred view requests no longer attempt to bind DSV-only formats (45, 20) and returnfalse, cleanly leaving plane selection to the dedicated selector in PR #651.R24_UNORM_X8_TYPELESS,X24_TYPELESS_G8_UINT,R32_FLOAT_X8X24_TYPELESS,X32_TYPELESS_G8X24_UINT) are passed through untouched.cargo test -p victory-gpuand clippy pass cleanly).@andrewpozdnakov7-jpg on GitHub · 2026-11-24 13:36 UTC · original
I checked the explicit
R8G8B8A8_TYPELESSSRV request on native Windows WARP. For the same generated typeless 1×1 render target, theffe310eformat check retained DXGI format 27. The regression stops at that check before asking D3D12 to create the view.On
5e3c9e2and the updatedb7a0a8c, the request resolved toR8G8B8A8_UNORM. Acs_6_0shader loaded the texel through the adapted SRV and a separate explicit UNORM control. Both returned the same four channels, quantized to[255, 128, 64, 255]. The diagnostics library run onb7a0a8c, including this fixture, passed 58 tests with one benchmark ignored.AI-assisted. This verifies the explicit color format in a synthetic readback on software D3D12.
@Xvania7 on GitHub · 2026-11-24 13:45 UTC · original
Thanks @pushkarreddyy for the aspect-aware resolution! Since my updated branch b7a0a8c already includes those exact depth/stencil rules (R16_UNORM vs R16_FLOAT, and leaving planar formats to the #651 selector), it would be great if you could review if my implementation matches your findings. I'd appreciate your thoughts on whether we should consolidate our branches!
@pushkarreddyy on GitHub · 2026-11-24 14:13 UTC · original · edited 2026-11-24 14:21 UTC
Thanks @Xvania7! Great to see that the aspect-aware resolution and depth/stencil format rules we established are now reflected in your branch.
We will keep our branch fix/gpu-typeless-srv-aspect-aware (commit 60222b3) active and independent, as maintainer @LAKSHYA-cmd-tech has already tested and verified our exact mapping rules in downstream PR #25. Having the standalone, cleanly scoped commit with full test coverage available gives @Marvisak and the merge team a clean, direct integration branch.
@pushkarreddyy on GitHub · 2026-11-24 13:36 UTC · original · edited 2026-11-24 14:22 UTC
Implemented the aspect-aware resolution addressing the depth/stencil format review in #882:
It maps R8G8B8A8_TYPELESS (27) to R8G8B8A8_UNORM (28) as verified on your branch, while safely remapping depth families (19->21, 44->46, 39->41, 53->56) to their legal depth SRV formats rather than DSV attachment formats.
@pushkarreddyy on GitHub · 2026-11-24 14:37 UTC · original
Pull request is now open for review: #970.
@rpmaster2 on GitHub · 2026-11-24 14:45 UTC · original · edited 2026-11-24 14:54 UTC
@Xvania7 an AMD result for this branch: it is a large step for the picture, not a complete one.
Tested
fix/issue-850-typeless-view(fetched head b7a0a8c) on top ofmain@ffe310e, diag build,VICTORY_D3D12_DRED=1, RX 9070 XT 16 GB (RDNA4), Adrenalin 26.11.2, Windows 11 26300. 300 s from a restored save, no other PRs applied.descriptor/host.rsandresource.rschange, and it merged cleanly ontoffe310e; it does not merge cleanly with #643/#581 (same functions), so it has to be rebased if those land first.One thing it does not fix: graphics still overlap in this build - layers accumulate in the same frame instead of replacing each other. That is a separate defect from the typeless view formats.
No game data attached: counts, formats and error strings only.
AI-assisted: written by DeepSeek (OpenCode harness) from my run logs and the user's screen observations; the hardware and the dump are mine.
@DrDarkDK on GitHub · 2026-11-24 15:06 UTC · original
I checked
default_srv_descon2be93af, the follow-up that synthesizes an SRV when the caller omits the descriptor. I passed it descriptions from realR8G8B8A8_TYPELESStextures on native Windows with RTX 4070 Ti and WARP.The single-sample texture and array produced the expected
TEXTURE2DandTEXTURE2DARRAYdimensions. The 4× MSAA versions produced the same dimensions on both adapters. D3D12 expectsTEXTURE2DMSandTEXTURE2DMSARRAYfor those resources.The helper checks the resource dimension and array size but does not check
SampleDesc.Count. The test inspected the generated descriptor before SRV creation.AI-assisted with Codex.
@Xvania7 on GitHub · 2026-11-24 16:15 UTC · original
@DrDarkDK Great catch on
SampleDesc.Count! You were completely right — synthesizing a plainTEXTURE2DSRV for 4x MSAA surfaces causes D3D12 to complain about dimensionality mismatch.We've updated
default_srv_descto inspectresource.SampleDesc.Count > 1:D3D12_SRV_DIMENSION_TEXTURE2D/TEXTURE2DARRAY.D3D12_SRV_DIMENSION_TEXTURE2DMS(andD3D12_SRV_DIMENSION_TEXTURE2DMSARRAYfor arrays with matchingArraySize).Pushed in commit 442bd60. Thanks for helping tighten this up!
@luisaugustz on GitHub · 2026-11-24 18:10 UTC · original
RX 9070 XT data point: on our stack the typeless remap did not bring back the cutscene picture
Machine: RX 9070 XT, Adrenalin 32.0.32029.2010, Windows 11 build 26300, title 1.0.2.1, diag build.
Tree: r4tedx
integration/testers(92bc27b) + #638 + #302/#489/#710. That tree'sfits()already differs fromffe310e's (sRGB casts, packed 16-bit targets), so I did not take this branch'shost.rswhole. I grafted its core instead: a typeless or unnamed view of a typeless resource takesfirst_concrete()of the family, R24G8 and R32G8X24 are refused, andR16_TYPELESSdepth becomesR16_UNORM.is_typelessandfirst_concreteare as in5e3c9e2.Result, intro cutscene, before and after:
So on this card and stack, the typeless views are not, or not alone, what blanks the cutscene. We have kept the change in the stack.
AI-assisted (Claude Code): measured in-game on this machine. No game data.
@Xvania7 on GitHub · 2026-11-24 18:14 UTC · original
Thanks for the RX 9070 XT datapoint @luisaugustz. This confirms what we've been seeing in other threads: the typeless remap is necessary (it fixes the texture binding), but it's not sufficient to bring back the picture.
The remaining black screen is caused by the FSR4 upscaler (
amd_fidelityfx_upscaler_xbox.dll) pushing FSPX (RDNA2) compute shaders, which get dropped because they lack DXIL. We are currently testing a fallback to force the game to use its internal DXIL post-process shaders instead. You can follow the experiment in #887.@luisaugustz on GitHub · 2026-11-24 18:19 UTC · original
@Xvania7 thanks, that fits the 3840x2160 output staying empty. One data point from the same RX 9070 XT stack suggests a second problem in front of the upscaler:
shader does not translateerror: 40 dropped compute hashes, none without one. None is logged as dropped for having no DXIL.amd_fidelityfx_loader_xbox.dlldoes load (4 HLE and 18 host imports bound). So on our side, the FSR dispatches either don't reach VIctory as programs at all, or are dropped somewhere that doesn't log.So the DXIL post-process fallback from #887 would be worth trying here too. On this card, though, we would expect it to bring back the 4K output, but not the lit image itself. Our leads for that are the skipped
CS_RaytracingResolvevariants (RTGI and reflection hit shading) and thertdirectionalshadowsprograms that do not translate, as on #71.AI-assisted (Claude Code): from this machine's logs and target dumps. Counts only.
@Xvania7 on GitHub · 2026-11-24 18:24 UTC · original
@luisaugustz That target dump analysis is gold — it cleanly decouples the pipeline into two independent blockers:
CS_RaytracingResolvefor RTGI/reflections andrtdirectionalshadows), the direct/indirect lighting passes never write to the2560x1440 RGBA16FHDR accumulation target. It stays at clear color.So there are indeed two stages to clear:
experiment/fspx-force-dxil) tests forcing the upscaler / engine to activate its internal fallback path to produce the 4K presentation target.Could you share the exact
error = "..."strings attached to theshader does not translatewarnings for those 40 compute hashes (specifically forCS_RaytracingResolveandrtdirectionalshadows)? That will tell us whether they are failing ondescriptor read only as data(addressed by #979 / #1067 / #1130),lane maskspill tracking (#298 / #309), unstructured buffer stride (#816), or specific raytracing intrinsics.@Xvania7 on GitHub · 2026-11-24 18:40 UTC · original
@luisaugustz That explains the flat 2560x1440 RGBA16F buffer completely.
The dropped compute pipelines you observed are the RT resolution passes (
CS_RaytracingResolvevariants for direct/indirect lighting) and directional shadow passes (rtdirectionalshadows), which hitimage_bvh_intersect_ray(opcode0x0e6) andimage_bvh64_intersect_ray(opcode0x0e7). Sincecrates/victory-shaderhad no lowering path for BVH intersection opcodes, the translation bailed withShaderError::Unsupported, dropping all 40 compute pipelines and leaving the HDR accumulation buffer unwritten.I have implemented an emulation pass for
image_bvh_intersect_ray/image_bvh64_intersect_rayon branchfeat/bvh-raytracing-fallback:vdata). On RDNA2, zero child hit mask terminates the BVH traversal loop as a clean miss.This allows all dropped compute programs to compile and execute their shading loops, populating the 2560x1440 HDR buffer before TAA and FSR4.
Could you test branch
feat/bvh-raytracing-fallbackon your RX 9070 XT setup to verify if the accumulation target now receives lit pixels?@HenriqueSBueno on GitHub · 2026-11-24 19:28 UTC · original
Matching observation from a different stack, in case it helps confirm the scope (RTX 3080, Series S profile, 1280x720 internal). A target dump of a world frame (229 targets) shows the G-buffer colour/normal/mask targets with geometry, while every lighting/HDR target at 1280x720 (DXGI formats 10, 26, 42, 61) is all zero and the final 1920x1080 output is uninitialised. On our side the passes that should fill them are dropped compute pipelines rather than failed views: lane-mask translation refusals and, per #1533, BVH instructions. Combined with this PR's typeless-view fix, those are the three pieces we would expect to matter for the black post-process. Details and the refusal breakdown are in #1317.
AI-assisted (Claude Code)
@Marvisak on GitHub · 2026-11-25 06:53 UTC · original
Automated triage for the maintainers.
On
main,fitsincrates/victory-gpu/src/descriptor/host.rsleaves a typeless view format on a typeless texture as it is (which the host refuses), and a view without a format of a typeless texture is refused, so such views end up null. The branch here (b7a0a8c, plus442bd60for MSAA defaults) maps them to a concrete format. Pull requests are open to everyone, so please open one from it, or compare with open pull request #970 (pushkarreddyy), which carries the aspect-aware version of the same remap, and agree on one; #651 handles the depth/stencil plane choice. Test results in the thread show the remap is real but not sufficient on its own: the cutscene picture of #850 still comes back only partly (RX 9070 XT runs above). The cutscene itself is discussed in #850.Generated by Claude Code