GPU: aspect-aware concrete format resolution for typeless views (fixes #882, #876) #970

Open
github-bot wants to merge 1 commit from github-bot/gh-970 into main AGit
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 14:36 UTC · original
pushkarreddyy:fix/gpu-typeless-srv-aspect-aware → main · +254 −25 · 2 files · 1 commits · open

Fixes #882, #876.

Root Cause

On main, fits() in crates/victory-gpu/src/descriptor/host.rs leaves typeless view formats (_TYPELESS) untouched when creating SRVs/UAVs on _TYPELESS host textures, and refuses views without an explicit description. D3D12 rejects _TYPELESS view formats and None view descriptions on _TYPELESS resources, causing views to fall back to null.

Implementation Details

  1. Aspect- and Usage-Aware Concrete Format Mapping (crates/victory-gpu/src/resource.rs):
    • Added is_typeless(format) with checked_add(1) overflow protection for malformed/boundary format words (e.g. u32::MAX).
    • Added concrete_view_format(format, depth, unordered) -> Option<u32> which:
      • Resolves depth typeless and attachment formats (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.
      • Distinguishes R16_TYPELESS (53) by ALLOW_DEPTH_STENCIL: R16_UNORM (56) for depth resources vs. R16_FLOAT (54) for non-depth color/UAV resources.
      • Resolves color typeless families (90 -> 87, 88|92 -> 88, 94 -> 95, and standard f + 1 families).
      • Returns None when unordered == true for formats without legal D3D12 UAV support (planar depth/stencil, D16_UNORM, B8G8R8X8, and block-compressed 70..=84 / 94..=99).
  2. Default Descriptor Synthesis & fits() Validation (crates/victory-gpu/src/descriptor/host.rs):
    • Added default_srv_desc and default_uav_desc to synthesize full D3D12_SHADER_RESOURCE_VIEW_DESC / D3D12_UNORDERED_ACCESS_VIEW_DESC structures (dimension, mip count, array/depth extent, seeded from view_format(resource)) when a title omits pDesc on a typeless host texture.
    • Updated fits() to track ALLOW_DEPTH_STENCIL, return false if format remains None on a typeless texture (guaranteeing None never reaches D3D12), and resolve view formats via concrete_view_format(view, depth, unordered).
    • Wired default_srv_desc and default_uav_desc into make() for View::Shader and View::Unordered.

Verification

  • Unit Tests: concrete_view_format_resolves_color_depth_uav_and_bounds in crates/victory-gpu/src/resource.rs verifies color, depth, R16_TYPELESS depth vs. color/UAV, planar depth UAV rejection, BC UAV rejection, and 0/u32::MAX bounds.
  • Hardware Testing: Community verification on RTX 4090, RX 7700 XT, and RTX 5090 / WARP (VICTORY_D3D12_DEBUG=1).
  • CI: check (build, clippy -D warnings, workspace tests) passing on d782a7d.

Scope & Limitations

  • Only view format resolution and omitted-descriptor synthesis are modified; resource allocation and depth-stencil plane selection (#651) remain unchanged.
  • No title files, captures, or proprietary assets were used.
**@⁠pushkarreddyy** on GitHub · 2026-11-24 14:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/970) `pushkarreddyy:fix/gpu-typeless-srv-aspect-aware` → `main` · +254 −25 · 2 files · 1 commits · open Fixes #882, #876. ### Root Cause On `main`, `fits()` in `crates/victory-gpu/src/descriptor/host.rs` leaves typeless view formats (`_TYPELESS`) untouched when creating SRVs/UAVs on `_TYPELESS` host textures, and refuses views without an explicit description. D3D12 rejects `_TYPELESS` view formats and `None` view descriptions on `_TYPELESS` resources, causing views to fall back to null. ### Implementation Details 1. **Aspect- and Usage-Aware Concrete Format Mapping (`crates/victory-gpu/src/resource.rs`):** - Added `is_typeless(format)` with `checked_add(1)` overflow protection for malformed/boundary format words (e.g. `u32::MAX`). - Added `concrete_view_format(format, depth, unordered) -> Option<u32>` which: - Resolves depth typeless and attachment formats (`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. - Distinguishes `R16_TYPELESS` (`53`) by `ALLOW_DEPTH_STENCIL`: `R16_UNORM` (`56`) for depth resources vs. `R16_FLOAT` (`54`) for non-depth color/UAV resources. - Resolves color typeless families (`90` -> `87`, `88|92` -> `88`, `94` -> `95`, and standard `f + 1` families). - Returns `None` when `unordered == true` for formats without legal D3D12 UAV support (planar depth/stencil, `D16_UNORM`, `B8G8R8X8`, and block-compressed `70..=84` / `94..=99`). 2. **Default Descriptor Synthesis & `fits()` Validation (`crates/victory-gpu/src/descriptor/host.rs`):** - Added `default_srv_desc` and `default_uav_desc` to synthesize full `D3D12_SHADER_RESOURCE_VIEW_DESC` / `D3D12_UNORDERED_ACCESS_VIEW_DESC` structures (dimension, mip count, array/depth extent, seeded from `view_format(resource)`) when a title omits `pDesc` on a typeless host texture. - Updated `fits()` to track `ALLOW_DEPTH_STENCIL`, return `false` if `format` remains `None` on a typeless texture (guaranteeing `None` never reaches D3D12), and resolve view formats via `concrete_view_format(view, depth, unordered)`. - Wired `default_srv_desc` and `default_uav_desc` into `make()` for `View::Shader` and `View::Unordered`. ### Verification - **Unit Tests:** `concrete_view_format_resolves_color_depth_uav_and_bounds` in `crates/victory-gpu/src/resource.rs` verifies color, depth, `R16_TYPELESS` depth vs. color/UAV, planar depth UAV rejection, BC UAV rejection, and `0`/`u32::MAX` bounds. - **Hardware Testing:** Community verification on RTX 4090, RX 7700 XT, and RTX 5090 / WARP (`VICTORY_D3D12_DEBUG=1`). - **CI:** `check` (build, clippy `-D warnings`, workspace tests) passing on `d782a7d`. ### Scope & Limitations - Only view format resolution and omitted-descriptor synthesis are modified; resource allocation and depth-stencil plane selection (`#651`) remain unchanged. - No title files, captures, or proprietary assets were used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:15:19 +00:00
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 14:47 UTC · original

The format-table test passed at 60222b3. A separate preparation-only check used a live R24G8_TYPELESS depth texture on RTX 4090 under Wine/vkd3d-proton 3.2. For an explicit SRV descriptor, both UNKNOWN and R24G8_TYPELESS resolved to the depth-plane format R24_UNORM_X8_TYPELESS (46).

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.

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 14:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7134944526) The format-table test passed at `60222b3`. A separate preparation-only check used a live R24G8_TYPELESS depth texture on RTX 4090 under Wine/vkd3d-proton 3.2. For an explicit SRV descriptor, both UNKNOWN and R24G8_TYPELESS resolved to the depth-plane format R24_UNORM_X8_TYPELESS (46). 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.
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 15:13 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 60222b3: cargo test -p victory-gpu passes, 51 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 15:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7135653532) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 60222b3: `cargo test -p victory-gpu` passes, 51 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-24 15:28 UTC · original

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!

**@⁠pushkarreddyy** on GitHub · 2026-11-24 15:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7136092751) 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!
Author
Owner

@⁠Yaekai on GitHub · 2026-11-24 15:53 UTC · original

Code review of 60222b3 — the depth-vs-color mapping table in concrete_srv_format() is clean and avoids the DSV-format pitfall, but there are 3 edge cases worth fixing before merge:

  1. format == None on a typeless resource (crates/victory-gpu/src/descriptor/host.rs:609-617):
    When the title omits a view description (CreateShaderResourceView(tex, NULL, ...) / CreateUnorderedAccessView(tex, NULL, NULL, ...)), format is None (view == 0), so if let Some(format) = format is skipped and fits() still returns true. That lets make() pass None to D3D12 on a _TYPELESS resource, which is illegal in D3D12 (E_INVALIDARG / debug-layer error). Either return false when typeless && format.is_none() or synthesize a concrete D3D12_SHADER_RESOURCE_VIEW_DESC / D3D12_UNORDERED_ACCESS_VIEW_DESC (as in Xvania7/VIctory@2be93af).
  2. is_typeless(u32::MAX) overflow (crates/victory-gpu/src/resource.rs:278):
    family(format + 1) will overflow in debug builds if a malformed/guest format word is u32::MAX; format.checked_add(1).is_some_and(...) avoids it.
  3. R16_TYPELESS (53) color vs depth & UAVs:
    concrete_srv_format(53) unconditionally maps to R16_UNORM (56), which is right for ALLOW_DEPTH_STENCIL resources, whereas non-depth color R16_TYPELESS textures typically expect R16_FLOAT (54). Also, planar depth formats (21 / 46) are valid for SRVs but not for unordered == true (UAVs).
**@⁠Yaekai** on GitHub · 2026-11-24 15:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7136794118) Code review of `60222b3` — the depth-vs-color mapping table in `concrete_srv_format()` is clean and avoids the DSV-format pitfall, but there are 3 edge cases worth fixing before merge: 1. **`format == None` on a typeless resource (`crates/victory-gpu/src/descriptor/host.rs:609-617`):** When the title omits a view description (`CreateShaderResourceView(tex, NULL, ...)` / `CreateUnorderedAccessView(tex, NULL, NULL, ...)`), `format` is `None` (`view == 0`), so `if let Some(format) = format` is skipped and `fits()` still returns `true`. That lets `make()` pass `None` to D3D12 on a `_TYPELESS` resource, which is illegal in D3D12 (`E_INVALIDARG` / debug-layer error). Either return `false` when `typeless && format.is_none()` or synthesize a concrete `D3D12_SHADER_RESOURCE_VIEW_DESC` / `D3D12_UNORDERED_ACCESS_VIEW_DESC` (as in `Xvania7/VIctory@2be93af`). 2. **`is_typeless(u32::MAX)` overflow (`crates/victory-gpu/src/resource.rs:278`):** `family(format + 1)` will overflow in debug builds if a malformed/guest format word is `u32::MAX`; `format.checked_add(1).is_some_and(...)` avoids it. 3. **`R16_TYPELESS` (53) color vs depth & UAVs:** `concrete_srv_format(53)` unconditionally maps to `R16_UNORM` (56), which is right for `ALLOW_DEPTH_STENCIL` resources, whereas non-depth color `R16_TYPELESS` textures typically expect `R16_FLOAT` (54). Also, planar depth formats (`21` / `46`) are valid for SRVs but not for `unordered == true` (UAVs).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 16:56 UTC · original

Put together a follow-up commit stacked directly on 60222b3 addressing the review points above and verified with GPU pixel readbacks on RTX 5090 and WARP (VICTORY_D3D12_DEBUG=1):

  1. Omitted pDesc (None) on typeless host textures: Synthesizes default_srv_desc / default_uav_desc from the host resource's dimension, mip count, and array/depth extent (seeded with view_format(resource) when widened from a typed console format), and returns false in fits if format is still None on a typeless resource so None never reaches D3D12 (E_INVALIDARG).
  2. is_typeless(u32::MAX) overflow: Uses format.checked_add(1).is_some_and(...).
  3. Aspect/usage-aware concrete_view_format(format, depth, unordered):
    • Maps R16_TYPELESS to R16_UNORM when ALLOW_DEPTH_STENCIL is set and R16_FLOAT for non-depth color/UAV resources (preserving explicit R16_UNORM views);
    • Translates explicit DSV formats (D32_FLOAT_S8X24_UINT, D32_FLOAT, D24_UNORM_S8_UINT, D16_UNORM) passed in SRV descriptors on typeless depth textures (#882);
    • Rejects planar depth/stencil, D16_UNORM, B8G8R8X8, and BC formats when unordered == true so unsupported UAVs fall back cleanly to null_for without device removal.

Synthetic cs_5_1 readbacks confirm 1.5 round-tripping through non-depth R16_TYPELESS null-desc UAV+SRV (R16_FLOAT), 0.5 on D16_UNORM-cleared R16_TYPELESS, and 0.75 on R24G8_TYPELESS via both null-desc and explicit D24_UNORM_S8_UINT SRVs with zero D3D12 debug errors. Feel free to cherry-pick: github.com/fuzeofficlal/VIctory@3802a0afda

**@⁠fuzeofficlal** on GitHub · 2026-11-24 16:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7138432534) Put together a follow-up commit stacked directly on `60222b3` addressing the review points above and verified with GPU pixel readbacks on RTX 5090 and WARP (`VICTORY_D3D12_DEBUG=1`): 1. **Omitted `pDesc` (`None`) on typeless host textures**: Synthesizes `default_srv_desc` / `default_uav_desc` from the host resource's dimension, mip count, and array/depth extent (seeded with `view_format(resource)` when widened from a typed console format), and returns `false` in `fits` if `format` is still `None` on a typeless resource so `None` never reaches D3D12 (`E_INVALIDARG`). 2. **`is_typeless(u32::MAX)` overflow**: Uses `format.checked_add(1).is_some_and(...)`. 3. **Aspect/usage-aware `concrete_view_format(format, depth, unordered)`**: - Maps `R16_TYPELESS` to `R16_UNORM` when `ALLOW_DEPTH_STENCIL` is set and `R16_FLOAT` for non-depth color/UAV resources (preserving explicit `R16_UNORM` views); - Translates explicit DSV formats (`D32_FLOAT_S8X24_UINT`, `D32_FLOAT`, `D24_UNORM_S8_UINT`, `D16_UNORM`) passed in SRV descriptors on typeless depth textures (`#882`); - Rejects planar depth/stencil, `D16_UNORM`, `B8G8R8X8`, and BC formats when `unordered == true` so unsupported UAVs fall back cleanly to `null_for` without device removal. Synthetic `cs_5_1` readbacks confirm `1.5` round-tripping through non-depth `R16_TYPELESS` null-desc UAV+SRV (`R16_FLOAT`), `0.5` on `D16_UNORM`-cleared `R16_TYPELESS`, and `0.75` on `R24G8_TYPELESS` via both null-desc and explicit `D24_UNORM_S8_UINT` SRVs with zero D3D12 debug errors. Feel free to cherry-pick: https://github.com/fuzeofficlal/VIctory/commit/3802a0afdab7f047d6ac0f038b0aa5257dcbcc68
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:30 UTC · original · edited 2026-11-25 22:16 UTC

Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main (conflict in crates/victory-gpu/src/descriptor/host.rs). It will be reviewed again once it is rebased.

From the earlier needs-work note, still open: move default_srv_desc/default_uav_desc above the doc comment of fits, and keep refusing (or give evidence for the format) when the title's own typeless texture has no view description.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7148586918) · edited 2026-11-25 22:16 UTC <!-- victory-triage v1 head=d782a7d1d15009b931e7b28df79c416d3b88e4f3 verdict=needs-rebase at=2026-11-25T22:18:35Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main` (conflict in `crates/victory-gpu/src/descriptor/host.rs`). It will be reviewed again once it is rebased. From the earlier needs-work note, still open: move `default_srv_desc`/`default_uav_desc` above the doc comment of `fits`, and keep refusing (or give evidence for the format) when the title's own typeless texture has no view description. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-25 01:47 UTC · original

Rebased cleanly onto latest main (940d32f), resolving the conflict in crates/victory-gpu/src/descriptor/host.rs with merged PR #974. Also included the is_typeless(u32::MAX) overflow guard suggested by @⁠Yaekai. Ready for maintainer review.

**@⁠pushkarreddyy** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7149962537) Rebased cleanly onto latest `main` (`940d32f`), resolving the conflict in `crates/victory-gpu/src/descriptor/host.rs` with merged PR #974. Also included the `is_typeless(u32::MAX)` overflow guard suggested by @⁠Yaekai. Ready for maintainer review.
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-25 12:46 UTC · original

Updated and pushed commit d782a7d addressing all triage review points:

  1. Omitted view descriptions on typeless textures: Added synthesized default SRV/UAV descriptors (default_srv_desc / default_uav_desc), and ensured fits returns false if format remains None so null descriptions never reach D3D12.
  2. UAV format bounds & depth isolation: Introduced concrete_view_format(format, depth, unordered) which rejects planar depth/stencil formats (19..=21, 22, 44..=46, 47, 55, 88/92) and block-compressed formats when unordered == true.
  3. R16_TYPELESS handling: Dispatches based on ALLOW_DEPTH_STENCIL to R16_UNORM (56) for depth resources and R16_FLOAT (54) for color/UAVs.
  4. Clippy & CI: Cleaned up the nested conditional (collapsible_if), resolved bounds overflow with checked_add, and added comprehensive unit tests covering color, depth, UAVs, and format bounds.

Thank you to @⁠fuzeofficlal and @⁠Yaekai for the detailed review feedback and hardware test findings.

**@⁠pushkarreddyy** on GitHub · 2026-11-25 12:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7162839932) Updated and pushed commit `d782a7d` addressing all triage review points: 1. **Omitted view descriptions on typeless textures:** Added synthesized default SRV/UAV descriptors (`default_srv_desc` / `default_uav_desc`), and ensured `fits` returns `false` if `format` remains `None` so null descriptions never reach D3D12. 2. **UAV format bounds & depth isolation:** Introduced `concrete_view_format(format, depth, unordered)` which rejects planar depth/stencil formats (19..=21, 22, 44..=46, 47, 55, 88/92) and block-compressed formats when `unordered == true`. 3. **`R16_TYPELESS` handling:** Dispatches based on `ALLOW_DEPTH_STENCIL` to `R16_UNORM` (56) for depth resources and `R16_FLOAT` (54) for color/UAVs. 4. **Clippy & CI:** Cleaned up the nested conditional (`collapsible_if`), resolved bounds overflow with `checked_add`, and added comprehensive unit tests covering color, depth, UAVs, and format bounds. Thank you to @⁠fuzeofficlal and @⁠Yaekai for the detailed review feedback and hardware test findings.
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-25 13:36 UTC · original

Hi @⁠Marvisak — all triage feedback points (default_srv_desc/default_uav_desc for omitted pDesc, fits returning false when format is None, UAV planar-depth/BC rejection, ALLOW_DEPTH_STENCIL-aware R16_TYPELESS resolution, and the Clippy fix) are resolved on d782a7d and CI (check) is passing. Ready for review and merge whenever convenient for #882 and #876!

**@⁠pushkarreddyy** on GitHub · 2026-11-25 13:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7164018713) Hi @⁠Marvisak — all triage feedback points (`default_srv_desc`/`default_uav_desc` for omitted `pDesc`, `fits` returning `false` when `format` is `None`, UAV planar-depth/BC rejection, `ALLOW_DEPTH_STENCIL`-aware `R16_TYPELESS` resolution, and the Clippy fix) are resolved on `d782a7d` and CI (`check`) is passing. Ready for review and merge whenever convenient for #882 and #876!
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-25 14:19 UTC · original

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 (d782a7d) in-title or with VICTORY_D3D12_DEBUG=1, test reports would be greatly appreciated!

AI-assisted: yes (Gemini 4 Neon)

**@⁠pushkarreddyy** on GitHub · 2026-11-25 14:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7165090751) 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 (`d782a7d`) in-title or with `VICTORY_D3D12_DEBUG=1`, test reports would be greatly appreciated! AI-assisted: yes (Gemini 4 Neon)
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-25 16:36 UTC · original

I ran a guest command-list readback on d782a7d with an RTX 4090 (driver 615.78.8), Wine 11.22 and vkd3d-proton 3.2. A 1×1 guest RGBA8 sRGB texture had typeless host backing. A compute dispatch wrote red byte 128 through its linear UAV, and a second dispatch read the same texel through the SRV. The shader stored round(1000 × red). Each case ran in a fresh process.

View descriptions Expected PR head With the SRV change below
Omitted 216 216 216
Explicit 2D descriptions with Format = UNKNOWN 216 502 216

The omitted descriptor preserves the sRGB conversion. For an explicit UNKNOWN SRV, fits sees format 0 and chooses the host family's linear UNORM format. In the control I changed only the SRV path in make: before calling fits, if the descriptor format is 0 and resource::view_format(resource) is Some, copy that known guest format into the descriptor. The UAV path and shaders were identical. The authored format-table test passed in both builds.

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 VICTORY_D3D12_DEBUG=1 on a diagnostics build; the evidence here is GPU readback, and I couldn't confirm a native debug layer was active under Wine. Synthetic textures and source-built shaders only. AI-assisted.

**@⁠MichaelSmithAI** on GitHub · 2026-11-25 16:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7168246423) I ran a guest command-list readback on `d782a7d` with an RTX 4090 (driver 615.78.8), Wine 11.22 and vkd3d-proton 3.2. A 1×1 guest RGBA8 sRGB texture had typeless host backing. A compute dispatch wrote red byte 128 through its linear UAV, and a second dispatch read the same texel through the SRV. The shader stored round(1000 × red). Each case ran in a fresh process. | View descriptions | Expected | PR head | With the SRV change below | |---|---:|---:|---:| | Omitted | 216 | 216 | 216 | | Explicit 2D descriptions with Format = UNKNOWN | 216 | 502 | 216 | The omitted descriptor preserves the sRGB conversion. For an explicit UNKNOWN SRV, `fits` sees format 0 and chooses the host family's linear UNORM format. In the control I changed only the SRV path in `make`: before calling `fits`, if the descriptor format is 0 and `resource::view_format(resource)` is Some, copy that known guest format into the descriptor. The UAV path and shaders were identical. The authored format-table test passed in both builds. 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 `VICTORY_D3D12_DEBUG=1` on a diagnostics build; the evidence here is GPU readback, and I couldn't confirm a native debug layer was active under Wine. Synthetic textures and source-built shaders only. AI-assisted.
github-bot force-pushed github-bot/gh-970 from d782a7d1d1 to a97587524b 2026-11-26 15:08:17 +00:00 Compare
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-26 15:07 UTC · original

Rebased cleanly onto latest main (63bcca4) in a975875:

  • Preserved main's explicit-UNKNOWN view_format(resource) lookup in make() (addressing @MichaelSmithAI's sRGB test case where explicit Format = UNKNOWN on a typed guest texture should retain the guest format).
  • Integrated main's typed_store checks on the resolved concrete UAV format so unsupported UAVs are still rejected cleanly.

Testers on untested GPU models (NVIDIA RTX 30/40/50 series, AMD RDNA2/RDNA3/RDNA4, Intel Arc, or Linux/Wine/vkd3d-proton) are welcome to verify a975875!

AI-assisted: yes (Gemini 4 Neon)

**@⁠pushkarreddyy** on GitHub · 2026-11-26 15:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7195822066) Rebased cleanly onto latest `main` (`63bcca4`) in `a975875`: - Preserved `main`'s explicit-`UNKNOWN` `view_format(resource)` lookup in `make()` (addressing `@MichaelSmithAI`'s sRGB test case where explicit `Format = UNKNOWN` on a typed guest texture should retain the guest format). - Integrated `main`'s `typed_store` checks on the resolved concrete UAV format so unsupported UAVs are still rejected cleanly. Testers on untested GPU models (NVIDIA RTX 30/40/50 series, AMD RDNA2/RDNA3/RDNA4, Intel Arc, or Linux/Wine/vkd3d-proton) are welcome to verify `a975875`! AI-assisted: yes (Gemini 4 Neon)
github-bot force-pushed github-bot/gh-970 from a97587524b to 27c69cf3a5 2026-11-26 15:19:42 +00:00 Compare
github-bot force-pushed github-bot/gh-970 from 27c69cf3a5 to 312e584a30 2026-11-26 15:25:29 +00:00 Compare
Author
Owner

@⁠pushkarreddyy on GitHub · 2026-11-26 15:23 UTC · original

Rebased onto main (63bcca4) at commit 312e584 and updated to align with the new placed-UAV host descriptor rules:

  • concrete_view_format: D32_FLOAT (40) and D16_UNORM (55) now require depth && !unordered (returning None for non-depth resources or unordered views).
  • descriptor::host::fits: explicitly rejects typeless view formats (is_typeless(view)) when a non-UNKNOWN view format is provided.
  • Updated concrete_view_format_resolves_color_depth_uav_and_bounds unit tests to cover non-depth and UAV cases for 40 and 55.

@⁠Marvisak: CI check is passing after the rebase. Testers on untested GPU models / drivers are welcome to verify typeless SRV/UAV rendering on this build.

AI-assisted: yes (Gemini 4 Neon)

**@⁠pushkarreddyy** on GitHub · 2026-11-26 15:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/970#issuecomment-7196194255) Rebased onto `main` (`63bcca4`) at commit `312e584` and updated to align with the new placed-UAV host descriptor rules: - `concrete_view_format`: `D32_FLOAT` (`40`) and `D16_UNORM` (`55`) now require `depth && !unordered` (returning `None` for non-depth resources or unordered views). - `descriptor::host::fits`: explicitly rejects typeless view formats (`is_typeless(view)`) when a non-`UNKNOWN` view format is provided. - Updated `concrete_view_format_resolves_color_depth_uav_and_bounds` unit tests to cover non-depth and UAV cases for `40` and `55`. @⁠Marvisak: CI `check` is passing after the rebase. Testers on untested GPU models / drivers are welcome to verify typeless SRV/UAV rendering on this build. AI-assisted: yes (Gemini 4 Neon)
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/970/head:github-bot/gh-970'
git switch 'github-bot/gh-970'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-970'
git switch 'github-bot/gh-970'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-970'
git switch 'github-bot/gh-970'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-970'
git switch 'main'
git merge --squash 'github-bot/gh-970'
git switch 'main'
git merge --ff-only 'github-bot/gh-970'
git switch 'main'
git merge 'github-bot/gh-970'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!970
No description provided.