gpu/tiles: preserve ResourceMinLODClamp in show_from #36

Merged
Androtim merged 1 commit from upstream-pr/36 into main 2026-11-28 18:44:34 +00:00
Androtim commented 2026-11-28 10:43:14 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T10:43:14Z.


Summary

Port rustno1-coder/VIctory-NVIDIA d8b258a (after xceless/victory-fork PR #1210 / 41f9857):

  • In crates/victory-gpu/src/tiles.rs (show_from()), preserve ResourceMinLODClamp for both Texture2D and Texture2DArray views when advancing MostDetailedMip and clamping MipLevels to the first resident tiled level, because D3D12 measures ResourceMinLODClamp relative to resource mip .
  • Updated show_from_preserves_resource_min_lod_for_2d_and_2d_array and levels_on_demand_on_the_card::sample_resident_views to verify both min_lod = 0.0 -> [32, 0] and min_lod = 3.0 -> [64, 64] on the hardware card.

Rig Specs Tested On

  • CPU: 13th Gen Intel(R) Core(TM) i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 Home (Build 26300) / Driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA:
    elease @ $sha (unit tests + VICTORY_TILES_TEST_CARD=1 D3D12 hardware card test on RTX 4060 Ti + CI full workspace suite)
  • Console Profile & Internal Resolution / Scale: N/A (levels_on_demand_on_the_card hardware D3D12 tiled resources test; default runtime preset keeps VICTORY_LEVELS_ON_DEMAND=0)
  • Ray Tracing: N/A
  • Upscaling: N/A
  • Frame Generation: N/A
  • Launcher Command / Preset & Extra VICTORY_ Overrides:* VICTORY_TILES_TEST_CARD=1 for levels_on_demand_on_the_card
  • Scene / Area & Session Length: N/A

Measurements & Verification

  • Base FPS (without Frame Gen): N/A (on-demand tiled-resource SRV view-clamping fix)
  • Frame-Gen FPS (if enabled): N/A
  • VRAM / RAM Usage: N/A
  • Crashes / DRED Resets: N/A
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (sset policy: 294 files ok)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask (6 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features victory-gpu/diagnostics -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib -- --test-threads=1 (448 passed; 0 failed; 36 ignored, including show_from_preserves_resource_min_lod_for_2d_and_2d_array)
    • VICTORY_TILES_TEST_CARD=1 cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib tiles::tests::levels_on_demand_on_the_card -- --ignored --nocapture (1 passed; 0 failed, sample at LOD 0, minimum 0: adjusted and original [32, 0], sample at LOD 0, minimum 3: adjusted and original [64, 64], ll steps passed ON THE CARD on RTX 4060 Ti)
    • cargo +1.98.1-x86_64-pc-windows-gnu build --release -p victory + objdump -p (0 non-system MinGW DLLs)
    • Full workspace test suite via GitHub Actions CI
<!-- greyfinch-sync:Androtim/MiniVI:issue:5539292877 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/36). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T10:43:14Z. --- ## Summary Port rustno1-coder/VIctory-NVIDIA d8b258a (after xceless/victory-fork PR #1210 / 41f9857): - In crates/victory-gpu/src/tiles.rs (show_from()), preserve ResourceMinLODClamp for both Texture2D and Texture2DArray views when advancing MostDetailedMip and clamping MipLevels to the first resident tiled level, because D3D12 measures ResourceMinLODClamp relative to resource mip . - Updated show_from_preserves_resource_min_lod_for_2d_and_2d_array and levels_on_demand_on_the_card::sample_resident_views to verify both min_lod = 0.0 -> [32, 0] and min_lod = 3.0 -> [64, 64] on the hardware card. ## Rig Specs Tested On - **CPU:** 13th Gen Intel(R) Core(TM) i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 Home (Build 26300) / Driver 32.0.16.2124 ## Run Settings & Profile - **Build & Commit SHA:** elease @ $sha (unit tests + VICTORY_TILES_TEST_CARD=1 D3D12 hardware card test on RTX 4060 Ti + CI full workspace suite) - **Console Profile & Internal Resolution / Scale:** N/A (levels_on_demand_on_the_card hardware D3D12 tiled resources test; default runtime preset keeps VICTORY_LEVELS_ON_DEMAND=0) - **Ray Tracing:** N/A - **Upscaling:** N/A - **Frame Generation:** N/A - **Launcher Command / Preset & Extra VICTORY_* Overrides:** VICTORY_TILES_TEST_CARD=1 for levels_on_demand_on_the_card - **Scene / Area & Session Length:** N/A ## Measurements & Verification - **Base FPS (without Frame Gen):** N/A (on-demand tiled-resource SRV view-clamping fix) - **Frame-Gen FPS (if enabled):** N/A - **VRAM / RAM Usage:** N/A - **Crashes / DRED Resets:** N/A - **Automated Checks:** - [x] cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (sset policy: 294 files ok) - [x] cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask (6 passed; 0 failed) - [x] cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings (0 warnings) - [x] cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features victory-gpu/diagnostics -- -D warnings (0 warnings) - [x] cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib -- --test-threads=1 (448 passed; 0 failed; 36 ignored, including show_from_preserves_resource_min_lod_for_2d_and_2d_array) - [x] VICTORY_TILES_TEST_CARD=1 cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib tiles::tests::levels_on_demand_on_the_card -- --ignored --nocapture (1 passed; 0 failed, sample at LOD 0, minimum 0: adjusted and original [32, 0], sample at LOD 0, minimum 3: adjusted and original [64, 64], ll steps passed ON THE CARD on RTX 4060 Ti) - [x] cargo +1.98.1-x86_64-pc-windows-gnu build --release -p victory + objdump -p (0 non-system MinGW DLLs) - [ ] Full workspace test suite via GitHub Actions CI
Androtim commented 2026-11-28 11:02:59 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T11:02:59Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Review Summary

Logic and safety look solid, CI is passing, and the change is tightly scoped to crates/victory-gpu/src/tiles.rs.

Verified changes:

  • show_from (crates/victory-gpu/src/tiles.rs): Removes the subtraction of fewer = first - *most from ResourceMinLODClamp for both D3D12_SRV_DIMENSION_TEXTURE2D and D3D12_SRV_DIMENSION_TEXTURE2DARRAY. In D3D12, ResourceMinLODClamp is relative to mip 0 of the underlying resource rather than MostDetailedMip, so leaving it unchanged preserves the effective minimum LOD when advancing MostDetailedMip to the first resident tiled level.
  • Unit test show_from_preserves_resource_min_lod_for_2d_and_2d_array: Updated assertions to verify ResourceMinLODClamp stays 3.5 (2D) and 1.5 (2D array) while MostDetailedMip and MipLevels are still clamped as expected.
  • Ignored hardware test levels_on_demand_on_the_card / sample_resident_views: Parameterized over min_lod to check both (0.0, [32, 0]) and (3.0, [64, 64]); the readback pointer read (data.cast::<[u32; 2]>().read()) is within the mapped 16-byte D3D12_RANGE on a D3D12 readback buffer.

Next step before merging:
Because this modifies D3D12 SRV descriptor clamping and an #[ignore]d on-card tiled-resource test that does not execute on real GPU hardware in CI, a local real-GPU verification run is recommended before merging.


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7238292955 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/36#issuecomment-7238292955). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T11:02:59Z. --- <!-- minivi-triage v1 head=dc6c216be18b12638d55f12930c0a0ac45eb2f37 verdict=needs-gpu-test ci=passing at=2026-11-28T11:03:26Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary Logic and safety look solid, CI is passing, and the change is tightly scoped to `crates/victory-gpu/src/tiles.rs`. **Verified changes:** - `show_from` (`crates/victory-gpu/src/tiles.rs`): Removes the subtraction of `fewer = first - *most` from `ResourceMinLODClamp` for both `D3D12_SRV_DIMENSION_TEXTURE2D` and `D3D12_SRV_DIMENSION_TEXTURE2DARRAY`. In D3D12, `ResourceMinLODClamp` is relative to mip 0 of the underlying resource rather than `MostDetailedMip`, so leaving it unchanged preserves the effective minimum LOD when advancing `MostDetailedMip` to the first resident tiled level. - Unit test `show_from_preserves_resource_min_lod_for_2d_and_2d_array`: Updated assertions to verify `ResourceMinLODClamp` stays `3.5` (2D) and `1.5` (2D array) while `MostDetailedMip` and `MipLevels` are still clamped as expected. - Ignored hardware test `levels_on_demand_on_the_card` / `sample_resident_views`: Parameterized over `min_lod` to check both `(0.0, [32, 0])` and `(3.0, [64, 64])`; the readback pointer read (`data.cast::<[u32; 2]>().read()`) is within the mapped 16-byte `D3D12_RANGE` on a D3D12 readback buffer. **Next step before merging:** Because this modifies D3D12 SRV descriptor clamping and an `#[ignore]`d on-card tiled-resource test that does not execute on real GPU hardware in CI, a local real-GPU verification run is recommended before merging. --- _Generated with Antigravity CLI (`agy`)._
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Androtim/MiniVI!36
No description provided.