[Ready to merge] Map typeless texture views to concrete formats (fixes #850) #876

Open
opened 2026-11-26 04:14:06 +00:00 by github-bot · 19 comments
Owner

@⁠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 / format 27 on MRT render targets) where the texture unit interprets the underlying data. On PC D3D12, ID3D12Device::CreateShaderResourceView and CreateUnorderedAccessView return E_INVALIDARG if the view description specifies a _TYPELESS format.

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

  1. Format resolution (crates/victory-gpu/src/resource.rs):
    • Added is_typeless(format: u32) -> bool to reliably detect root typeless formats across all DXGI families.
    • Added first_concrete(format: u32) -> u32 to map typeless formats to their primary typed view format (R8G8B8A8_TYPELESS -> R8G8B8A8_UNORM, B8G8R8A8_TYPELESS -> B8G8R8A8_UNORM, R32_TYPELESS -> R32_FLOAT, etc.).
  2. View adaptation (crates/victory-gpu/src/descriptor/host.rs):
    • Added adapt_view_format() to remap typeless and unknown view requests on typeless resources to the concrete format before dispatching to D3D12.
  3. Unit tests:
    • Added tests covering typeless-on-typeless remapping, typed-on-typeless preservation, and UAV linear conversion.

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 ignored
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings
  • cargo xtask policy: 154 files ok

Ready to merge cleanly.

**@⁠Xvania7** on GitHub · 2026-11-24 13:08 UTC · [original](https://github.com/Marvisak/VIctory/issues/876) 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` / format `27` on MRT render targets) where the texture unit interprets the underlying data. On PC D3D12, `ID3D12Device::CreateShaderResourceView` and `CreateUnorderedAccessView` return `E_INVALIDARG` if the view description specifies a `_TYPELESS` format. 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 1. **Format resolution (`crates/victory-gpu/src/resource.rs`)**: - Added `is_typeless(format: u32) -> bool` to reliably detect root typeless formats across all DXGI families. - Added `first_concrete(format: u32) -> u32` to map typeless formats to their primary typed view format (`R8G8B8A8_TYPELESS` -> `R8G8B8A8_UNORM`, `B8G8R8A8_TYPELESS` -> `B8G8R8A8_UNORM`, `R32_TYPELESS` -> `R32_FLOAT`, etc.). 2. **View adaptation (`crates/victory-gpu/src/descriptor/host.rs`)**: - Added `adapt_view_format()` to remap typeless and unknown view requests on typeless resources to the concrete format before dispatching to D3D12. 3. **Unit tests**: - Added tests covering typeless-on-typeless remapping, typed-on-typeless preservation, and UAV linear conversion. ### 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 ignored - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: 0 warnings - `cargo xtask policy`: 154 files ok Ready to merge cleanly.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:06 +00:00
Author
Owner

@⁠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 + 1 rule has a counterexample in 5e3c9e2: 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 table

The 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.

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 13:17 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7132619219) 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](https://github.com/MichaelSmithAI/VIctory/tree/test/876-rgba8-views) The general `f + 1` rule has a counterexample in `5e3c9e2`: 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 table](https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/hardware-support-for-direct3d-12-0-formats#dxgi_format_d24_unorm_s8_uint-45) The 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.
Author
Owner

@⁠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_UNKNOWN in the guest description, ffe310e supplied a legal null SRV and the shader read red 0.0. On 5e3c9e2, the shader read 0.50196081, matching the explicit UNORM SRV. The explicit sRGB control stayed near 0.216 on 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) and R32G8X24_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 uses R16_UNORM for the inferred view on depth-capable R16_TYPELESS and keeps R16_FLOAT for 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.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 13:21 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7132711937) I ran a native Windows A/B with a generated RGBA8 typeless texture and explicit Texture2D SRV descriptions. With `DXGI_FORMAT_UNKNOWN` in the guest description, `ffe310e` supplied a legal null SRV and the shader read red `0.0`. On `5e3c9e2`, the shader read `0.50196081`, matching the explicit UNORM SRV. The explicit sRGB control stayed near `0.216` on 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) and `R32G8X24_TYPELESS` (19 → 20). [Follow-up commit](https://github.com/fuzeofficlal/VIctory/commit/f25e9d522cc8527af7df48eeb1229e516e9e2aa9) leaves those ambiguous requests to a plane-aware selector such as #651 and preserves all four explicit readable depth and stencil formats. It uses `R16_UNORM` for the inferred view on depth-capable `R16_TYPELESS` and keeps `R16_FLOAT` for 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.
Author
Owner

@⁠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.

**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 13:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7132779002) 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.
Author
Owner

@⁠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 + 1 trap on DSV formats.

I have updated the branch fix/issue-850-typeless-view (commit b7a0a8c):

  1. R16_TYPELESS: Checks ALLOW_DEPTH_STENCIL on the underlying resource — maps to R16_UNORM if depth-capable, otherwise R16_FLOAT for color resources.
  2. Planar depth formats (R24G8_TYPELESS, R32G8X24_TYPELESS): Ambiguous/inferred view requests no longer attempt to bind DSV-only formats (45, 20) and return false, cleanly leaving plane selection to the dedicated selector in PR #651.
  3. Explicit readable views: All 4 readable depth/stencil SRV formats (R24_UNORM_X8_TYPELESS, X24_TYPELESS_G8_UINT, R32_FLOAT_X8X24_TYPELESS, X32_TYPELESS_G8X24_UINT) are passed through untouched.
  4. Added synthetic unit tests verifying depth vs color selection and planar depth SRV requirements (cargo test -p victory-gpu and clippy pass cleanly).
**@⁠Xvania7** on GitHub · 2026-11-24 13:36 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7133070451) 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 + 1` trap on DSV formats. I have updated the branch [`fix/issue-850-typeless-view`](https://github.com/Xvania7/VIctory/tree/fix/issue-850-typeless-view) (commit `b7a0a8c`): 1. **`R16_TYPELESS`**: Checks `ALLOW_DEPTH_STENCIL` on the underlying resource — maps to `R16_UNORM` if depth-capable, otherwise `R16_FLOAT` for color resources. 2. **Planar depth formats (`R24G8_TYPELESS`, `R32G8X24_TYPELESS`)**: Ambiguous/inferred view requests no longer attempt to bind DSV-only formats (45, 20) and return `false`, cleanly leaving plane selection to the dedicated selector in PR #651. 3. **Explicit readable views**: All 4 readable depth/stencil SRV formats (`R24_UNORM_X8_TYPELESS`, `X24_TYPELESS_G8_UINT`, `R32_FLOAT_X8X24_TYPELESS`, `X32_TYPELESS_G8X24_UINT`) are passed through untouched. 4. Added synthetic unit tests verifying depth vs color selection and planar depth SRV requirements (`cargo test -p victory-gpu` and clippy pass cleanly).
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-24 13:36 UTC · original

I checked the explicit R8G8B8A8_TYPELESS SRV request on native Windows WARP. For the same generated typeless 1×1 render target, the ffe310e format check retained DXGI format 27. The regression stops at that check before asking D3D12 to create the view.

On 5e3c9e2 and the updated b7a0a8c, the request resolved to R8G8B8A8_UNORM. A cs_6_0 shader 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 on b7a0a8c, 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.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-24 13:36 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7133084868) I checked the explicit `R8G8B8A8_TYPELESS` SRV request on native Windows WARP. For the same generated typeless 1×1 render target, the `ffe310e` format check retained DXGI format 27. The regression stops at that check before asking D3D12 to create the view. On `5e3c9e2` and the updated `b7a0a8c`, the request resolved to `R8G8B8A8_UNORM`. A `cs_6_0` shader 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 on `b7a0a8c`, 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.
Author
Owner

@⁠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!

**@⁠Xvania7** on GitHub · 2026-11-24 13:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7133288521) 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!
Author
Owner

@⁠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 14:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7134024465) · 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](https://github.com/pushkarreddyy/VIctory/tree/fix/gpu-typeless-srv-aspect-aware) (commit [60222b3](https://github.com/pushkarreddyy/VIctory/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.
Author
Owner

@⁠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 13:36 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7133082891) · edited 2026-11-24 14:22 UTC Implemented the aspect-aware resolution addressing the depth/stencil format review in #882: - **Branch:** [fix/gpu-typeless-srv-aspect-aware](https://github.com/pushkarreddyy/VIctory/tree/fix/gpu-typeless-srv-aspect-aware) - **Commit:** [60222b3](https://github.com/pushkarreddyy/VIctory/commit/60222b3) - **Compare:** https://github.com/Marvisak/VIctory/compare/main...pushkarreddyy:VIctory:fix/gpu-typeless-srv-aspect-aware 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.
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 14:37 UTC · original

Pull request is now open for review: #970.

**@⁠pushkarreddyy** on GitHub · 2026-11-24 14:37 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7134681260) Pull request is now open for review: #970.
Author
Owner

@⁠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 of main @⁠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.

  • The credits scene renders on this host now: the art-deco arch field on the right, name lists in pink, ~77 draws/frame at 0.6-0.8 fps. Before this branch the same scene on the same host was a flat colour with only the UI layer visible.
  • 300 s survived with no device removal, but black frames are not gone: 21-23 warnings per 300 s at 0.6-0.8 fps is roughly one presented frame in ten, with 9-12 transitions back to a visible frame. So on this host the branch makes the picture appear far more often, it does not make it continuous.
  • Only descriptor/host.rs and resource.rs change, and it merged cleanly onto ffe310e; 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.

**@⁠rpmaster2** on GitHub · 2026-11-24 14:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7134910796) · 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 of `main` @⁠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. - The credits scene renders on this host now: the art-deco arch field on the right, name lists in pink, ~77 draws/frame at 0.6-0.8 fps. Before this branch the same scene on the same host was a flat colour with only the UI layer visible. - 300 s survived with **no device removal**, but black frames are **not gone**: 21-23 warnings per 300 s at 0.6-0.8 fps is roughly one presented frame in ten, with 9-12 transitions back to a visible frame. So on this host the branch makes the picture appear far more often, it does not make it continuous. - Only `descriptor/host.rs` and `resource.rs` change, and it merged cleanly onto `ffe310e`; 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.
Author
Owner

@⁠DrDarkDK on GitHub · 2026-11-24 15:06 UTC · original

I checked default_srv_desc on 2be93af, the follow-up that synthesizes an SRV when the caller omits the descriptor. I passed it descriptions from real R8G8B8A8_TYPELESS textures on native Windows with RTX 4070 Ti and WARP.

The single-sample texture and array produced the expected TEXTURE2D and TEXTURE2DARRAY dimensions. The 4× MSAA versions produced the same dimensions on both adapters. D3D12 expects TEXTURE2DMS and TEXTURE2DMSARRAY for 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.

**@⁠DrDarkDK** on GitHub · 2026-11-24 15:06 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7135466226) I checked `default_srv_desc` on `2be93af`, the follow-up that synthesizes an SRV when the caller omits the descriptor. I passed it descriptions from real `R8G8B8A8_TYPELESS` textures on native Windows with RTX 4070 Ti and WARP. The single-sample texture and array produced the expected `TEXTURE2D` and `TEXTURE2DARRAY` dimensions. The 4× MSAA versions produced the same dimensions on both adapters. D3D12 expects `TEXTURE2DMS` and `TEXTURE2DMSARRAY` for 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.*
Author
Owner

@⁠Xvania7 on GitHub · 2026-11-24 16:15 UTC · original

@⁠DrDarkDK Great catch on SampleDesc.Count! You were completely right — synthesizing a plain TEXTURE2D SRV for 4x MSAA surfaces causes D3D12 to complain about dimensionality mismatch.

We've updated default_srv_desc to inspect resource.SampleDesc.Count > 1:

  • Single-sample textures continue to map to D3D12_SRV_DIMENSION_TEXTURE2D / TEXTURE2DARRAY.
  • Multisampled textures now correctly map to D3D12_SRV_DIMENSION_TEXTURE2DMS (and D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY for arrays with matching ArraySize).

Pushed in commit 442bd60. Thanks for helping tighten this up!

**@⁠Xvania7** on GitHub · 2026-11-24 16:15 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7137376182) @⁠DrDarkDK Great catch on `SampleDesc.Count`! You were completely right — synthesizing a plain `TEXTURE2D` SRV for 4x MSAA surfaces causes D3D12 to complain about dimensionality mismatch. We've updated `default_srv_desc` to inspect `resource.SampleDesc.Count > 1`: - Single-sample textures continue to map to `D3D12_SRV_DIMENSION_TEXTURE2D` / `TEXTURE2DARRAY`. - Multisampled textures now correctly map to `D3D12_SRV_DIMENSION_TEXTURE2DMS` (and `D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY` for arrays with matching `ArraySize`). Pushed in commit [442bd60](https://github.com/Xvania7/VIctory/commit/442bd60deaf8a7a58cb33bf57fb1cae770c64bd8). Thanks for helping tighten this up!
Author
Owner

@⁠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's fits() already differs from ffe310e's (sRGB casts, packed 16-bit targets), so I did not take this branch's host.rs whole. I grafted its core instead: a typeless or unnamed view of a typeless resource takes first_concrete() of the family, R24G8 and R32G8X24 are refused, and R16_TYPELESS depth becomes R16_UNORM. is_typeless and first_concrete are as in 5e3c9e2.

Result, intro cutscene, before and after:

  • Subtitles and the "[NOVE MESES ATRÁS]" card render in both.
  • The picture is the same flat dark slate in both, the #850 symptom.
  • No new warnings, no device removal, and no regression elsewhere that we saw.

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.

**@⁠luisaugustz** on GitHub · 2026-11-24 18:10 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7140260611) **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's `fits()` already differs from `ffe310e`'s (sRGB casts, packed 16-bit targets), so I did not take this branch's `host.rs` whole. I grafted its core instead: a typeless or unnamed view of a typeless resource takes `first_concrete()` of the family, R24G8 and R32G8X24 are refused, and `R16_TYPELESS` depth becomes `R16_UNORM`. `is_typeless` and `first_concrete` are as in `5e3c9e2`. **Result, intro cutscene, before and after:** - Subtitles and the "[NOVE MESES ATRÁS]" card render in both. - The picture is the same flat dark slate in both, the #850 symptom. - No new warnings, no device removal, and no regression elsewhere that we saw. 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._
Author
Owner

@⁠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.

**@⁠Xvania7** on GitHub · 2026-11-24 18:14 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7140354238) 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.
Author
Owner

@⁠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:

  • The 2560x1440 RGBA16F target that TAA writes, and that bloom reads afterwards, is already flat in our world dumps: a few KB as PNG, at the same frames where the G-buffer targets hold geometry. So the image the upscaler would take as input is already empty.
  • In that run, every compute program dropped for lack of a host pipeline has a shader does not translate error: 40 dropped compute hashes, none without one. None is logged as dropped for having no DXIL. amd_fidelityfx_loader_xbox.dll does 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_RaytracingResolve variants (RTGI and reflection hit shading) and the rtdirectionalshadows programs that do not translate, as on #71.

AI-assisted (Claude Code): from this machine's logs and target dumps. Counts only.

**@⁠luisaugustz** on GitHub · 2026-11-24 18:19 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7140473546) @⁠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: - The 2560x1440 RGBA16F target that TAA writes, and that bloom reads afterwards, is already flat in our world dumps: a few KB as PNG, at the same frames where the G-buffer targets hold geometry. So the image the upscaler would take as input is already empty. - In that run, every compute program dropped for lack of a host pipeline has a `shader does not translate` error: 40 dropped compute hashes, none without one. None is logged as dropped for having no DXIL. `amd_fidelityfx_loader_xbox.dll` does 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_RaytracingResolve` variants (RTGI and reflection hit shading) and the `rtdirectionalshadows` programs that do not translate, as on #71. _AI-assisted (Claude Code): from this machine's logs and target dumps. Counts only._
Author
Owner

@⁠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:

  1. Geometry pass is intact: G-buffer holding valid geometry proves vertex/mesh and G-buffer pixel shaders are executing properly.
  2. Lighting pass is starved: Because the 40 compute programs fail translation (CS_RaytracingResolve for RTGI/reflections and rtdirectionalshadows), the direct/indirect lighting passes never write to the 2560x1440 RGBA16F HDR accumulation target. It stays at clear color.
  3. Post-process / Upscale starved: TAA and bloom read zeros from the unlit HDR target, and FSR4 receives a black frame. Even if FSR4 produces 4K output, it upscales empty pixels.

So there are indeed two stages to clear:

  • The experimental branch on #887 (experiment/fspx-force-dxil) tests forcing the upscaler / engine to activate its internal fallback path to produce the 4K presentation target.
  • But to get the lit world into that 1440p target beforehand, we need those 40 lighting compute programs to translate.

Could you share the exact error = "..." strings attached to the shader does not translate warnings for those 40 compute hashes (specifically for CS_RaytracingResolve and rtdirectionalshadows)? That will tell us whether they are failing on descriptor read only as data (addressed by #979 / #1067 / #1130), lane mask spill tracking (#298 / #309), unstructured buffer stride (#816), or specific raytracing intrinsics.

**@⁠Xvania7** on GitHub · 2026-11-24 18:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7140590609) @⁠luisaugustz That target dump analysis is gold — it cleanly decouples the pipeline into two independent blockers: 1. **Geometry pass is intact:** G-buffer holding valid geometry proves vertex/mesh and G-buffer pixel shaders are executing properly. 2. **Lighting pass is starved:** Because the 40 compute programs fail translation (`CS_RaytracingResolve` for RTGI/reflections and `rtdirectionalshadows`), the direct/indirect lighting passes never write to the `2560x1440 RGBA16F` HDR accumulation target. It stays at clear color. 3. **Post-process / Upscale starved:** TAA and bloom read zeros from the unlit HDR target, and FSR4 receives a black frame. Even if FSR4 produces 4K output, it upscales empty pixels. So there are indeed two stages to clear: - The experimental branch on #887 (`experiment/fspx-force-dxil`) tests forcing the upscaler / engine to activate its internal fallback path to produce the 4K presentation target. - But to get the lit world into that 1440p target beforehand, we need those 40 lighting compute programs to translate. Could you share the exact `error = "..."` strings attached to the `shader does not translate` warnings for those 40 compute hashes (specifically for `CS_RaytracingResolve` and `rtdirectionalshadows`)? That will tell us whether they are failing on `descriptor read only as data` (addressed by #979 / #1067 / #1130), `lane mask` spill tracking (#298 / #309), unstructured buffer stride (#816), or specific raytracing intrinsics.
Author
Owner

@⁠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_RaytracingResolve variants for direct/indirect lighting) and directional shadow passes (rtdirectionalshadows), which hit image_bvh_intersect_ray (opcode 0x0e6) and image_bvh64_intersect_ray (opcode 0x0e7). Since crates/victory-shader had no lowering path for BVH intersection opcodes, the translation bailed with ShaderError::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_ray on branch feat/bvh-raytracing-fallback:

  1. Fallback as Miss: Zeroes out the 4-dword intersection result vector (vdata). On RDNA2, zero child hit mask terminates the BVH traversal loop as a clean miss.
    • For shadows: ray misses occluders -> surfaces are treated as lit.
    • For RTGI / reflections: ray misses geometry -> shader falls back to probe / skybox radiance.
  2. Descriptor mapping: BVH descriptors are mapped as raw byte buffers so dimension queries succeed without image layout mismatches.

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-fallback on your RX 9070 XT setup to verify if the accumulation target now receives lit pixels?

**@⁠Xvania7** on GitHub · 2026-11-24 18:40 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7140979149) @⁠luisaugustz That explains the flat 2560x1440 RGBA16F buffer completely. The dropped compute pipelines you observed are the RT resolution passes (`CS_RaytracingResolve` variants for direct/indirect lighting) and directional shadow passes (`rtdirectionalshadows`), which hit `image_bvh_intersect_ray` (opcode `0x0e6`) and `image_bvh64_intersect_ray` (opcode `0x0e7`). Since `crates/victory-shader` had no lowering path for BVH intersection opcodes, the translation bailed with `ShaderError::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_ray` on branch [`feat/bvh-raytracing-fallback`](https://github.com/Xvania7/VIctory/tree/feat/bvh-raytracing-fallback): 1. **Fallback as Miss**: Zeroes out the 4-dword intersection result vector (`vdata`). On RDNA2, zero child hit mask terminates the BVH traversal loop as a clean miss. - For shadows: ray misses occluders -> surfaces are treated as lit. - For RTGI / reflections: ray misses geometry -> shader falls back to probe / skybox radiance. 2. **Descriptor mapping**: BVH descriptors are mapped as raw byte buffers so dimension queries succeed without image layout mismatches. 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-fallback` on your RX 9070 XT setup to verify if the accumulation target now receives lit pixels?
Author
Owner

@⁠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)

**@⁠HenriqueSBueno** on GitHub · 2026-11-24 19:28 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7142159227) 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)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:53 UTC · original

Automated triage for the maintainers.

On main, fits in crates/victory-gpu/src/descriptor/host.rs leaves 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, plus 442bd60 for 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

**@⁠Marvisak** on GitHub · 2026-11-25 06:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/876#issuecomment-7155258225) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T19:28:59Z at=2026-11-25T06:53:01Z --> Automated triage for the maintainers. On `main`, `fits` in `crates/victory-gpu/src/descriptor/host.rs` leaves 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`, plus `442bd60` for 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](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#876
No description provided.