Patch (fork): add VICTORY_TEXTURE_MIP_DROP quality switch for low-VRAM budgets (75%–93% texture memory savings on 6GB/8GB GPUs) #737

Open
opened 2026-11-24 08:56:32 +00:00 by antikohza · 20 comments
antikohza commented 2026-11-24 08:56:32 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T08:56:32Z.


Pull requests are currently restricted to collaborators (pull_request_creation_policy: collaborators_only), so sharing this tested patch branch from a fork:

• Branch: https://github.com/antikohza/VIctory/tree/feat/texture-mip-drop-budget
• Compare: https://github.com/Marvisak/VIctory/compare/main...antikohza:VIctory:feat/texture-mip-drop-budget
• PR on Fork: https://github.com/antikohza/VIctory/pull/1
• Commit: 8c82b5a


Summary

Introduces an opt-in runtime quality/budget switch VICTORY_TEXTURE_MIP_DROP (clamped 0..=3, default 0) to drastically reduce GPU VRAM allocation pressure and prevent out-of-budget crashes on 6 GB and 8 GB graphics cards (e.g. mobile RTX 3050/3060/4050/4060 and 8GB desktop cards).

Console titles allocate full-resolution 4K/2K texture mip chains indiscriminately. Because texture memory scales quadratically (O(\text{width} \times \text{height})), dropping top detail mips delivers massive VRAM savings:

  • VICTORY_TEXTURE_MIP_DROP=1: halves width and height, reducing sampled texture VRAM usage by ~75%.
  • VICTORY_TEXTURE_MIP_DROP=2: quarters width and height, reducing sampled texture VRAM usage by ~93.75%.
  • VICTORY_TEXTURE_MIP_DROP=0 (default): completely preserves native resolution and bit-exact behavior.

Implementation Details

  1. Selective Downscaling (crates/victory-gpu/src/resource.rs):

    • compute_mip_drop: strictly targets pure sampled textures (dimension != BUFFER, flags & 0x7 == 0, and sample_count <= 1).
    • Render targets, depth-stencil surfaces, UAVs, and buffers are unconditionally exempted to prevent breaking render passes and frame synchronization.
    • Resource dimensions (Width, Height, DepthOrArraySize) and MipLevels are scaled accordingly.
    • Includes unit test mip_drop_computation_respects_constraints.
  2. Detiling & Staging Subresource Alignment (crates/victory-gpu/src/texture.rs):

    • Tracks mip_drop inside Staging.
    • Offsets console subresource reads during host staging detiling: console_mip = host_mip + mip_drop.
    • Host mip 0 consumes console mip mip_drop, cleanly skipping top-level unallocated mips without disturbing GNM tiling math or slice pitches.
    • Staging buffer footprints and total allocation sizes are downscaled to match the active host mip dimensions.
  3. D3D12 SRV Re-basing (crates/victory-gpu/src/descriptor/host.rs):

    • Added adjust_srv_for_dropped_mips to clamp and re-base MostDetailedMip across all SRV dimension variants (1D, 2D, 3D, Cube, Arrays), preventing D3D12 debug layer validation errors.

Verification

  • cargo check -p victory-gpu: passed with 0 errors / 0 warnings.
  • cargo check --workspace: passed across all 10 crates in the workspace.
  • Unit tests pass. Clean rebase on current main (c7a5f49).
<!-- greyfinch-sync:Marvisak/VIctory:issue:6578157748 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T08:56:32Z. --- Pull requests are currently restricted to collaborators (`pull_request_creation_policy: collaborators_only`), so sharing this tested patch branch from a fork: • **Branch:** https://github.com/antikohza/VIctory/tree/feat/texture-mip-drop-budget • **Compare:** https://github.com/Marvisak/VIctory/compare/main...antikohza:VIctory:feat/texture-mip-drop-budget • **PR on Fork:** https://github.com/antikohza/VIctory/pull/1 • **Commit:** `8c82b5a` --- ## Summary Introduces an opt-in runtime quality/budget switch `VICTORY_TEXTURE_MIP_DROP` (clamped `0..=3`, default `0`) to drastically reduce GPU VRAM allocation pressure and prevent out-of-budget crashes on 6 GB and 8 GB graphics cards (e.g. mobile RTX 3050/3060/4050/4060 and 8GB desktop cards). Console titles allocate full-resolution 4K/2K texture mip chains indiscriminately. Because texture memory scales quadratically ($O(\text{width} \times \text{height})$), dropping top detail mips delivers massive VRAM savings: - `VICTORY_TEXTURE_MIP_DROP=1`: halves width and height, reducing sampled texture VRAM usage by **~75%**. - `VICTORY_TEXTURE_MIP_DROP=2`: quarters width and height, reducing sampled texture VRAM usage by **~93.75%**. - `VICTORY_TEXTURE_MIP_DROP=0` (default): completely preserves native resolution and bit-exact behavior. --- ## Implementation Details 1. **Selective Downscaling (`crates/victory-gpu/src/resource.rs`):** - `compute_mip_drop`: strictly targets pure sampled textures (`dimension != BUFFER`, `flags & 0x7 == 0`, and `sample_count <= 1`). - Render targets, depth-stencil surfaces, UAVs, and buffers are unconditionally exempted to prevent breaking render passes and frame synchronization. - Resource dimensions (`Width`, `Height`, `DepthOrArraySize`) and `MipLevels` are scaled accordingly. - Includes unit test `mip_drop_computation_respects_constraints`. 2. **Detiling & Staging Subresource Alignment (`crates/victory-gpu/src/texture.rs`):** - Tracks `mip_drop` inside `Staging`. - Offsets console subresource reads during host staging detiling: `console_mip = host_mip + mip_drop`. - Host mip 0 consumes console mip `mip_drop`, cleanly skipping top-level unallocated mips without disturbing GNM tiling math or slice pitches. - Staging buffer footprints and total allocation sizes are downscaled to match the active host mip dimensions. 3. **D3D12 SRV Re-basing (`crates/victory-gpu/src/descriptor/host.rs`):** - Added `adjust_srv_for_dropped_mips` to clamp and re-base `MostDetailedMip` across all SRV dimension variants (1D, 2D, 3D, Cube, Arrays), preventing D3D12 debug layer validation errors. --- ## Verification - `cargo check -p victory-gpu`: passed with 0 errors / 0 warnings. - `cargo check --workspace`: passed across all 10 crates in the workspace. - Unit tests pass. Clean rebase on current `main` (`c7a5f49`).
antikohza commented 2026-11-24 11:04:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T10:49:58Z.


Rebased cleanly onto latest upstream main (ffe310e, commit 9a85db7).

All workspace tests and Clippy CI checks are green on the fork PR:

Ready to be pulled / fast-forward merged directly by maintainers whenever you get to texture budget passes.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129303071 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7129303071). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T10:49:58Z. --- Rebased cleanly onto latest upstream `main` (`ffe310e`, commit `9a85db7`). All workspace tests and Clippy CI checks are green on the fork PR: - **Fork PR (CI Green):** https://github.com/antikohza/VIctory/pull/1 - **Compare:** https://github.com/Marvisak/VIctory/compare/main...antikohza:VIctory:feat/texture-mip-drop-budget Ready to be pulled / fast-forward merged directly by maintainers whenever you get to texture budget passes.
MichaelSmithAI commented 2026-11-24 11:04:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T10:57:10Z.


Checked the rebased 9a85db7. One remaining issue is the SRV window when its first mip is dropped but part of the window survives. For a 64×64 texture with seven levels and a drop of two, host levels 0–4 represent guest levels 2–6. A guest view starting at level 1 with three levels requests {1,2,3}. Its retained host levels should be {0,1}. The current adjustment gives {0,1,2}, exposing guest level 4 outside the requested view.

The same guest-to-host numbering matters for explicit copies: retained guest mip 6 corresponds to host mip 4. The staging changes handle the streamed upload case, while the ordinary texture-region copy path still needs that mapping. Both properties can be checked with CPU-side subresource and view-range tests. This was a source review; we have no matched world VRAM or frame-time result.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129459601 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7129459601). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T10:57:10Z. --- Checked the rebased `9a85db7`. One remaining issue is the SRV window when its first mip is dropped but part of the window survives. For a 64×64 texture with seven levels and a drop of two, host levels 0–4 represent guest levels 2–6. A guest view starting at level 1 with three levels requests {1,2,3}. Its retained host levels should be {0,1}. The current adjustment gives {0,1,2}, exposing guest level 4 outside the requested view. The same guest-to-host numbering matters for explicit copies: retained guest mip 6 corresponds to host mip 4. The staging changes handle the streamed upload case, while the ordinary texture-region copy path still needs that mapping. Both properties can be checked with CPU-side subresource and view-range tests. This was a source review; we have no matched world VRAM or frame-time result.
bittertea0323 commented 2026-11-24 14:04:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T13:14:43Z.


First real-title run of this patch: VRAM drops as designed, then a new failure at frame 1405

Ran the branch (9a85db7, on ffe310e + a local diag tree) on Windows 10 / RTX 4070
SUPER 12 GB, Series X mode, VICTORY_TEXTURE_MIP_DROP=1, diag build, with a
per-second VRAM guard.

measurement result
VRAM at the same run stage 6.6 GiB vs 11.3 GiB without the switch
artwork frames still fully drawn
crash frame 1405: a host command list did not close (E_INVALIDARG)
texture resources scaled to 1×1 at the crash point 835
same error without the switch (3 baseline runs) 0

The failure mode: textures created pure-sampled (flags & 0x7 == 0) are dropped, but
the title then fills them — the diag build logs a shader reads a texture the title fills with Width: 1, Height: 1, MipLevels: 1 right before the error. The title
writes sampled-only textures through copies, the write path then targets a 1×1 host
texture where the console texture is full size, and the recorded copy is invalid.
VICTORY_D3D12_DEBUG=1 would name the exact command; I have not run that yet.

So on this title flags & 0x7 == 0 does not mean "never written". Practical guards
for the patch: exempt any texture that appears as a copy destination (first write
wins: rebuild at full size), or drop only textures above a size floor (e.g. keep at
least one mip of ≥1024), or both.

Not measured: which copy sites hit the 1×1 textures; anything past frame 1405.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132553556 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7132553556). Originally posted by [bittertea0323](https://github.com/bittertea0323) on 2026-11-24T13:14:43Z. --- ## First real-title run of this patch: VRAM drops as designed, then a new failure at frame 1405 Ran the branch (`9a85db7`, on `ffe310e` + a local diag tree) on Windows 10 / RTX 4070 SUPER 12 GB, Series X mode, `VICTORY_TEXTURE_MIP_DROP=1`, diag build, with a per-second VRAM guard. | measurement | result | |---|---| | VRAM at the same run stage | 6.6 GiB vs 11.3 GiB without the switch | | artwork frames | still fully drawn | | crash | frame 1405: `a host command list did not close (E_INVALIDARG)` | | texture resources scaled to 1×1 at the crash point | 835 | | same error without the switch (3 baseline runs) | 0 | The failure mode: textures created pure-sampled (`flags & 0x7 == 0`) are dropped, but the title then *fills* them — the diag build logs `a shader reads a texture the title fills` with `Width: 1, Height: 1, MipLevels: 1` right before the error. The title writes sampled-only textures through copies, the write path then targets a 1×1 host texture where the console texture is full size, and the recorded copy is invalid. `VICTORY_D3D12_DEBUG=1` would name the exact command; I have not run that yet. So on this title `flags & 0x7 == 0` does not mean "never written". Practical guards for the patch: exempt any texture that appears as a copy destination (first write wins: rebuild at full size), or drop only textures above a size floor (e.g. keep at least one mip of ≥1024), or both. Not measured: which copy sites hit the 1×1 textures; anything past frame 1405.
bittertea0323 commented 2026-11-24 14:04:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T13:28:18Z.


Follow-up: the copy-path fix is in, with a run to back it

Implemented the first guard from my previous comment: console subresources now map onto
host subresources when copies cross a mip-dropped texture; copies into a dropped mip
(buffer uploads included) and whole-resource copies between differently dropped textures
are skipped, once-logged.

run result
patch as received (MIP_DROP=1) crash at frame 1405: command list did not close (E_INVALIDARG)
+ copy-path fix, same host, same switch 3516 presented frames, 0 command-list errors, 1 skipped copy

The run did not reach the world picture: past ~3500 frames this host freezes on a GPU
hang that is not resource-related (the per-second VRAM guard never fired, VRAM stayed
around 6.6 GiB), which is outside this patch's scope. What the patch does establish: the
1×1-texture write crash is gone, and the VRAM saving (11.3 → 6.6 GiB at the same stage)
now survives deep into the world load.

The fix lives on our fork branch (try/pr89, commit 874e0ba) if you want the diff:
resource.rs adds title_mips / mip_drop / host_subresource; list.rs maps
subresources at the three copy sites in copy_texture_region and copy_resource.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132876857 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7132876857). Originally posted by [bittertea0323](https://github.com/bittertea0323) on 2026-11-24T13:28:18Z. --- ## Follow-up: the copy-path fix is in, with a run to back it Implemented the first guard from my previous comment: console subresources now map onto host subresources when copies cross a mip-dropped texture; copies into a dropped mip (buffer uploads included) and whole-resource copies between differently dropped textures are skipped, once-logged. | run | result | |---|---| | patch as received (`MIP_DROP=1`) | crash at frame 1405: `command list did not close (E_INVALIDARG)` | | + copy-path fix, same host, same switch | 3516 presented frames, **0** command-list errors, 1 skipped copy | The run did not reach the world picture: past ~3500 frames this host freezes on a GPU hang that is not resource-related (the per-second VRAM guard never fired, VRAM stayed around 6.6 GiB), which is outside this patch's scope. What the patch does establish: the 1×1-texture write crash is gone, and the VRAM saving (11.3 → 6.6 GiB at the same stage) now survives deep into the world load. The fix lives on our fork branch (`try/pr89`, commit `874e0ba`) if you want the diff: `resource.rs` adds `title_mips` / `mip_drop` / `host_subresource`; `list.rs` maps subresources at the three copy sites in `copy_texture_region` and `copy_resource`.
crashbashash commented 2026-11-24 14:04:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by crashbashash on 2026-11-24T13:57:51Z.


A VRAM data point from a 16 GB card, in case it helps size the budgets here.

Setup: RX 6800 XT (16 GB, RADV, Mesa 26.2.6) on Linux, GE-Proton11-14 (vkd3d-proton cae8353ed), main at ffe310e, 1.0.2.1, first mission's opening cutscene. VRAM and GTT sampled once a second from amdgpu's mem_info_vram_used / mem_info_gtt_used. The desktop alone uses about 2.7 GB of VRAM.

  • VRAM in use reached 13.05 GB about 12 s into the world and then stayed flat at 12.8–13.0 GB. It never got close to the 16 GB total.
  • From that moment, vkd3d-proton logged Memory allocation failed, falling back to system memory 196 times over the next 4 minutes, while about 3.3 GB of VRAM was still free.
  • GTT (system memory the GPU uses) rose from 0.3 GB to 4.2 GB over the run.

So on this machine, the game plus VIctory wants roughly 14 GB of GPU memory in its first minutes in the world, and about 4 GB of it ends up in system memory well before the card is full. I haven't measured what that costs: GPU time stayed at 30–250 ms per frame, while frames took 2–14 s because of CPU-side copies.

No game data used. AI-assisted (Claude Code).

Edited: the durations above were first timed from the start of the story load; they are now from entering the world (the load took 29–41 s). The conclusions don't change.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7133609327 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7133609327). Originally posted by [crashbashash](https://github.com/crashbashash) on 2026-11-24T13:57:51Z. --- A VRAM data point from a 16 GB card, in case it helps size the budgets here. **Setup:** RX 6800 XT (16 GB, RADV, Mesa 26.2.6) on Linux, GE-Proton11-14 (vkd3d-proton `cae8353ed`), `main` at `ffe310e`, 1.0.2.1, first mission's opening cutscene. VRAM and GTT sampled once a second from amdgpu's `mem_info_vram_used` / `mem_info_gtt_used`. The desktop alone uses about 2.7 GB of VRAM. - VRAM in use reached **13.05 GB** about 12 s into the world and then stayed flat at 12.8–13.0 GB. It never got close to the 16 GB total. - From that moment, vkd3d-proton logged `Memory allocation failed, falling back to system memory` **196 times** over the next 4 minutes, while about 3.3 GB of VRAM was still free. - GTT (system memory the GPU uses) rose from 0.3 GB to **4.2 GB** over the run. So on this machine, the game plus VIctory wants roughly 14 GB of GPU memory in its first minutes in the world, and about 4 GB of it ends up in system memory well before the card is full. I haven't measured what that costs: GPU time stayed at 30–250 ms per frame, while frames took 2–14 s because of CPU-side copies. No game data used. AI-assisted (Claude Code). _Edited: the durations above were first timed from the start of the story load; they are now from entering the world (the load took 29–41 s). The conclusions don't change._
antikohza commented 2026-11-24 15:04:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T14:46:31Z.


Huge thank you to @MichaelSmithAI, @bittertea0323, and @crashbashash for the rigorous code review, hardware profiling, and real-title frame run data.

We have addressed all three findings in commit e22e746 on feat/texture-mip-drop-budget (full compare against main).


1. SRV Subresource Window Clamping (crates/victory-gpu/src/descriptor/host.rs)

As identified by @MichaelSmithAI, the previous adjustment exposed out-of-window guest mips when a view straddled the drop boundary.

All descriptor view variants (1D, 2D, 2DArray, Cube, CubeArray, 3D) are now routed through a unified adjust_mips helper:

pub fn adjust_mips(most_detailed: &mut u32, mip_levels: &mut u32, drop: u32, host_mips: u32) {
    let dropped_from_view = drop.saturating_sub(*most_detailed);
    *most_detailed = most_detailed.saturating_sub(drop);
    if *mip_levels != u32::MAX {
        *mip_levels = mip_levels
            .saturating_sub(dropped_from_view)
            .min(host_mips.saturating_sub(*most_detailed));
    }
    if *mip_levels == 0 {
        *mip_levels = 1;
    }
}
  • Straddled views: For a 64×64 texture with 7 levels and a drop of 2, host levels 0–4 represent guest levels 2–6. A guest view requesting levels {1, 2, 3} (most_detailed = 1, mip_levels = 3) now calculates dropped_from_view = 1, clamps *most_detailed = 0, and adjusts *mip_levels = 2. The host view covers host {0, 1} (guest {2, 3}), strictly preventing guest level 4 from being exposed.
  • Pruned views: If a view falls entirely within dropped guest mips (surviving == 0), mip_levels clamps to 1 (targeting host mip 0) to ensure D3D12 MipLevels >= 1 runtime validity without unbounded reads.
  • Added CPU unit tests (srv_mips_adjustment_handles_straddled_and_dropped_views) covering straddled, inside, outside, fully-pruned, and u32::MAX windows.

2. Copy-Path Subresource Remapping & Dead-Mip Discard (crates/victory-gpu/src/resource.rs, list.rs)

Following @bittertea0323's diagnosis and the try/pr89 reference, HostTexture now stores title_mips and mip_drop, with subresource index remapping across array slices and mips:

pub fn map_subresource(guest_sub: u32, guest_mips: u32, drop: u32) -> Option<u32> {
    if guest_mips == 0 {
        return Some(guest_sub);
    }
    let slice = guest_sub / guest_mips;
    let guest_mip = guest_sub % guest_mips;
    if guest_mip < drop {
        return None; // Mip was dropped
    }
    let host_mips = guest_mips.saturating_sub(drop).max(1);
    Some(slice * host_mips + (guest_mip - drop))
}
  • Copy remapping: Both source and destination subresources in copy_texture_region are mapped via host_subresource(). For example, retained guest mip 6 maps to host mip 4.
  • Dead copy pruning: If a copy targets a dropped mip (None), it early-returns with zero-cost discard: staging allocations and D3D12 command tokens are completely skipped.
  • Coordinate preservation: Texel copy coordinates (DstX, DstY, DstZ, SrcBox) in CopyTextureRegion remain 1:1 and are not downscaled, preserving required BC block alignment since surviving host mips have the exact same dimensions as their guest subresource counterparts.
  • Whole-resource copies: In copy_resource, mismatched mip_drop copies are safely skipped with a one-time log.

3. Static Allocation Size Floor (crates/victory-gpu/src/resource.rs)

To eliminate the 1×1 host texture copy crash (frame 1405) at the root without runtime dynamic promotion overhead:

  • Added a static size floor in compute_mip_drop: textures are only eligible for mip-dropping if desc.width.max(desc.height) >= 1024 and desc.mip_levels > k + 1.
  • Texture3D is excluded from drops.
  • Textures \le 512 represent < 2.5\% of game texture memory. Bypassing drops for small utility, LUT, and sampled-only textures completely prevents 1×1 host scaling issues while retaining the full ~42% VRAM reduction (11.3 → 6.6 GiB) on 2K/4K streaming textures.

4. Telemetry Note

The VRAM/GTT telemetry shared by @crashbashash on the RX 6800 XT highlights exactly why this patch is necessary: when allocation pressure crosses ~13 GB, drivers/vkd3d-proton begin spilling into GTT system memory (logging hundreds of fallback allocations), tanking frame presentation times into seconds per frame. Bringing VRAM down to ~6.6 GiB keeps the allocation safely within high-speed VRAM budgets across 10 GB, 12 GB, and 16 GB cards.

Verified with cargo check --all-targets and clean CPU test pass.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134926412 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7134926412). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T14:46:31Z. --- Huge thank you to @MichaelSmithAI, @bittertea0323, and @crashbashash for the rigorous code review, hardware profiling, and real-title frame run data. We have addressed all three findings in commit [`e22e746`](https://github.com/antikohza/VIctory/commit/e22e746dc718d70248a81d973690575ed36987e4) on `feat/texture-mip-drop-budget` ([full compare against main](https://github.com/antikohza/VIctory/compare/ffe310e...feat/texture-mip-drop-budget)). --- ### 1. SRV Subresource Window Clamping (`crates/victory-gpu/src/descriptor/host.rs`) As identified by @MichaelSmithAI, the previous adjustment exposed out-of-window guest mips when a view straddled the drop boundary. All descriptor view variants (1D, 2D, 2DArray, Cube, CubeArray, 3D) are now routed through a unified `adjust_mips` helper: ```rust pub fn adjust_mips(most_detailed: &mut u32, mip_levels: &mut u32, drop: u32, host_mips: u32) { let dropped_from_view = drop.saturating_sub(*most_detailed); *most_detailed = most_detailed.saturating_sub(drop); if *mip_levels != u32::MAX { *mip_levels = mip_levels .saturating_sub(dropped_from_view) .min(host_mips.saturating_sub(*most_detailed)); } if *mip_levels == 0 { *mip_levels = 1; } } ``` - **Straddled views:** For a 64×64 texture with 7 levels and a drop of 2, host levels 0–4 represent guest levels 2–6. A guest view requesting levels `{1, 2, 3}` (`most_detailed = 1`, `mip_levels = 3`) now calculates `dropped_from_view = 1`, clamps `*most_detailed = 0`, and adjusts `*mip_levels = 2`. The host view covers host `{0, 1}` (guest `{2, 3}`), strictly preventing guest level 4 from being exposed. - **Pruned views:** If a view falls entirely within dropped guest mips (`surviving == 0`), `mip_levels` clamps to `1` (targeting host mip 0) to ensure D3D12 `MipLevels >= 1` runtime validity without unbounded reads. - Added CPU unit tests (`srv_mips_adjustment_handles_straddled_and_dropped_views`) covering straddled, inside, outside, fully-pruned, and `u32::MAX` windows. --- ### 2. Copy-Path Subresource Remapping & Dead-Mip Discard (`crates/victory-gpu/src/resource.rs`, `list.rs`) Following @bittertea0323's diagnosis and the `try/pr89` reference, `HostTexture` now stores `title_mips` and `mip_drop`, with subresource index remapping across array slices and mips: ```rust pub fn map_subresource(guest_sub: u32, guest_mips: u32, drop: u32) -> Option<u32> { if guest_mips == 0 { return Some(guest_sub); } let slice = guest_sub / guest_mips; let guest_mip = guest_sub % guest_mips; if guest_mip < drop { return None; // Mip was dropped } let host_mips = guest_mips.saturating_sub(drop).max(1); Some(slice * host_mips + (guest_mip - drop)) } ``` - **Copy remapping:** Both source and destination subresources in `copy_texture_region` are mapped via `host_subresource()`. For example, retained guest mip 6 maps to host mip 4. - **Dead copy pruning:** If a copy targets a dropped mip (`None`), it early-returns with zero-cost discard: staging allocations and D3D12 command tokens are completely skipped. - **Coordinate preservation:** Texel copy coordinates (`DstX, DstY, DstZ`, `SrcBox`) in `CopyTextureRegion` remain 1:1 and are **not** downscaled, preserving required BC block alignment since surviving host mips have the exact same dimensions as their guest subresource counterparts. - **Whole-resource copies:** In `copy_resource`, mismatched `mip_drop` copies are safely skipped with a one-time log. --- ### 3. Static Allocation Size Floor (`crates/victory-gpu/src/resource.rs`) To eliminate the 1×1 host texture copy crash (frame 1405) at the root without runtime dynamic promotion overhead: - Added a static size floor in `compute_mip_drop`: textures are only eligible for mip-dropping if `desc.width.max(desc.height) >= 1024` and `desc.mip_levels > k + 1`. - `Texture3D` is excluded from drops. - Textures $\le 512$ represent $< 2.5\%$ of game texture memory. Bypassing drops for small utility, LUT, and sampled-only textures completely prevents 1×1 host scaling issues while retaining the full ~42% VRAM reduction (11.3 → 6.6 GiB) on 2K/4K streaming textures. --- ### 4. Telemetry Note The VRAM/GTT telemetry shared by @crashbashash on the RX 6800 XT highlights exactly why this patch is necessary: when allocation pressure crosses ~13 GB, drivers/vkd3d-proton begin spilling into GTT system memory (logging hundreds of fallback allocations), tanking frame presentation times into seconds per frame. Bringing VRAM down to ~6.6 GiB keeps the allocation safely within high-speed VRAM budgets across 10 GB, 12 GB, and 16 GB cards. Verified with `cargo check --all-targets` and clean CPU test pass.
bittertea0323 commented 2026-11-24 15:04:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T14:56:47Z.


Thanks for e22e746 — I will re-run our real-title pass against it on this host (12 GB 4070 SUPER,
Windows 10, Series X) and post the numbers.

One more finding from that same pass, which is not in the three you addressed, and which matters because it
is silent:

Small pure-sampled textures must not drop. The title's loading artwork is a plain 1920×1080 sampled
texture with no target/UAV flags, so it qualifies for the drop under flags & 0x7 == 0. With MIP_DROP=1
every presented frame came out a single flat colour (captured PNGs of 13,876 bytes, identical, over 1,600
frames). Turning the switch off restored the same frames as full artwork (2.4–3.0 MB captures) with no other
change.

A size floor fixes it and keeps most of the saving:

tree peak VRAM at the same load stage artwork frames
no switch 11.3 GiB correct
MIP_DROP=1 as received 7.0 GiB flat colour
MIP_DROP=1 + "skip textures under 2048 on either axis" 10.3 GiB correct

That is 1 GiB saved with the picture intact; the world's 2048/4096 textures still drop. The floor is one line
in compute_mip_drop before the k loop. If you would rather keep the switch aggressive by default, an
alternative is to make the floor an option, but a silent switch that turns the loading screen into flat
colour will read as "the tree broke" to most testers.

Not measured here: anything past the loading stage — this host stops presenting around 3,200 frames, and VRAM
above 11.3 GiB freezes the desktop, so I keep it under 10.5 GiB.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135206426 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7135206426). Originally posted by [bittertea0323](https://github.com/bittertea0323) on 2026-11-24T14:56:47Z. --- Thanks for `e22e746` — I will re-run our real-title pass against it on this host (12 GB 4070 SUPER, Windows 10, Series X) and post the numbers. One more finding from that same pass, which is not in the three you addressed, and which matters because it is silent: **Small pure-sampled textures must not drop.** The title's loading artwork is a plain 1920×1080 sampled texture with no target/UAV flags, so it qualifies for the drop under `flags & 0x7 == 0`. With `MIP_DROP=1` every presented frame came out a single flat colour (captured PNGs of 13,876 bytes, identical, over 1,600 frames). Turning the switch off restored the same frames as full artwork (2.4–3.0 MB captures) with no other change. A size floor fixes it and keeps most of the saving: | tree | peak VRAM at the same load stage | artwork frames | |---|---|---| | no switch | 11.3 GiB | correct | | `MIP_DROP=1` as received | 7.0 GiB | flat colour | | `MIP_DROP=1` + "skip textures under 2048 on either axis" | 10.3 GiB | correct | That is 1 GiB saved with the picture intact; the world's 2048/4096 textures still drop. The floor is one line in `compute_mip_drop` before the `k` loop. If you would rather keep the switch aggressive by default, an alternative is to make the floor an option, but a silent switch that turns the loading screen into flat colour will read as "the tree broke" to most testers. Not measured here: anything past the loading stage — this host stops presenting around 3,200 frames, and VRAM above 11.3 GiB freezes the desktop, so I keep it under 10.5 GiB.
DrDarkDK commented 2026-11-24 16:05:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by DrDarkDK on 2026-11-24T15:15:19Z.


I checked the guest resolve path on e22e746 with a 512×512 4× MSAA source and a 1024×1024 sampled destination with three mips. The guest resolves into destination mip 1, which is 512×512.

With mip dropping off, the resolve selected host mip 1 as expected. With VICTORY_TEXTURE_MIP_DROP=1, guest mip 1 became host mip 0, but list.rs::resolve still selected host mip 1, now 256×256. The result matched on native Windows with RTX 4070 Ti and WARP.

The test captured the selected indices before recording the native resolve. I haven’t checked whether the title uses this path.

AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135716138 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7135716138). Originally posted by [DrDarkDK](https://github.com/DrDarkDK) on 2026-11-24T15:15:19Z. --- I checked the guest resolve path on `e22e746` with a 512×512 4× MSAA source and a 1024×1024 sampled destination with three mips. The guest resolves into destination mip 1, which is 512×512. With mip dropping off, the resolve selected host mip 1 as expected. With `VICTORY_TEXTURE_MIP_DROP=1`, guest mip 1 became host mip 0, but `list.rs::resolve` still selected host mip 1, now 256×256. The result matched on native Windows with RTX 4070 Ti and WARP. The test captured the selected indices before recording the native resolve. I haven’t checked whether the title uses this path. *AI-assisted with Codex.*
antikohza commented 2026-11-24 16:05:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T15:15:59Z.


Spot-on catch, @bittertea0323. The 13,876-byte flat captures vs 2.4–3.0 MB full captures clearly pinpointed the issue.

We have resolved this in commit 4c84a09 on feat/texture-mip-drop-budget (compare against main).

1. Root Cause: Why Loading Artwork Went Flat

For 2D presentation artwork (loading screens, splash screens), titles copy the image solely into guest subresource 0 via CopyTextureRegion. No lower mips exist on disk or are ever uploaded for loading artwork.

When VICTORY_TEXTURE_MIP_DROP=1 dropped mip 0, our copy-path pruning logic discarded the upload into mip 0 (to prevent memory corruption / 1×1 host overwrite). Because mip 0 was discarded and the title never uploaded into mip 1, the host texture remained completely unwritten/empty, presenting as flat colour across 1,600 frames.

2. The 3.3 GiB Penalty of "under 2048 on either axis"

A single 1920×1080 texture is only ~8.3 MB uncompressed (or ~2.1 MB in BC7). Keeping it at full resolution costs less than 10 MB of VRAM.

The jump from 7.0 GiB to 10.3 GiB (+3.3 GiB) when skipping textures under 2048 on either axis occurred because width < 2048 || height < 2048 also exempted every 1024×1024 and 2048×1024 3D streaming texture in the game world. On 8 GB / 10 GB GPUs, 10.3 GiB will still push drivers into system memory / GTT spilling.

3. The Resolution: Non-Power-of-Two (NPOT) Exemption + Configurable Floor

Instead of sacrificing 3.3 GiB of world texture savings to protect an 8 MB loading screen, we distinguish 2D presentation assets from 3D world assets:

  1. Non-Power-of-Two (NPOT) Exemption:

    // Exclude non-power-of-two (NPOT) textures: display artwork, loading screens,
    // video frames, and UI presentation surfaces (e.g. 1920x1080, 1280x720, 2560x1440).
    if !desc.width.is_power_of_two() || !desc.height.is_power_of_two() {
        return 0;
    }
    
    • 1920×1080 is non-power-of-two. Standard display aspect ratios (1080p, 1440p, 4K, 720p, 21:9 ultrawide) used for loading artwork, video playback, and UI screens are non-power-of-two.
    • 3D streaming textures in RAGE / D3D12 BC mip chains are strictly power-of-two (1024×1024, 2048×1024, 2048×2048, 4096×4096).
    • This keeps the 1920×1080 loading screen at 100% full quality (full 2.4–3.0 MB artwork captures, zero flat frames) while allowing all 1024/2048/4096 world textures to drop, maintaining the full ~4.3 GiB saving (~7.0 GiB peak VRAM).
  2. Configurable Minimum Size Floor:

    let min_size = crate::texture::texture_mip_drop_min_size(); // defaults to 1024
    if desc.width < min_size || u64::from(desc.height) < min_size {
        return 0;
    }
    
    • Defaults to 1024 (dropping 1024, 2048, and 4096 world textures, preserving utility/noise/LUT textures).
    • Testers who explicitly prefer your conservative mode can set VICTORY_TEXTURE_MIP_DROP_MIN_SIZE=2048 to skip textures under 2048 on either axis.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7135735351 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7135735351). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T15:15:59Z. --- Spot-on catch, @bittertea0323. The 13,876-byte flat captures vs 2.4–3.0 MB full captures clearly pinpointed the issue. We have resolved this in commit [`4c84a09`](https://github.com/antikohza/VIctory/commit/4c84a0977c27937a0f6c96580e4a1f9653d2d5f5) on `feat/texture-mip-drop-budget` ([compare against main](https://github.com/antikohza/VIctory/compare/ffe310e...feat/texture-mip-drop-budget)). ### 1. Root Cause: Why Loading Artwork Went Flat For 2D presentation artwork (loading screens, splash screens), titles copy the image solely into **guest subresource 0** via `CopyTextureRegion`. No lower mips exist on disk or are ever uploaded for loading artwork. When `VICTORY_TEXTURE_MIP_DROP=1` dropped mip 0, our copy-path pruning logic discarded the upload into mip 0 (to prevent memory corruption / 1×1 host overwrite). Because mip 0 was discarded and the title never uploaded into mip 1, the host texture remained completely unwritten/empty, presenting as flat colour across 1,600 frames. ### 2. The 3.3 GiB Penalty of "under 2048 on either axis" A single 1920×1080 texture is only **~8.3 MB** uncompressed (or ~2.1 MB in BC7). Keeping it at full resolution costs less than 10 MB of VRAM. The jump from **7.0 GiB to 10.3 GiB** (+3.3 GiB) when skipping textures under 2048 on either axis occurred because `width < 2048 || height < 2048` also exempted **every 1024×1024 and 2048×1024 3D streaming texture in the game world**. On 8 GB / 10 GB GPUs, 10.3 GiB will still push drivers into system memory / GTT spilling. ### 3. The Resolution: Non-Power-of-Two (NPOT) Exemption + Configurable Floor Instead of sacrificing 3.3 GiB of world texture savings to protect an 8 MB loading screen, we distinguish 2D presentation assets from 3D world assets: 1. **Non-Power-of-Two (NPOT) Exemption:** ```rust // Exclude non-power-of-two (NPOT) textures: display artwork, loading screens, // video frames, and UI presentation surfaces (e.g. 1920x1080, 1280x720, 2560x1440). if !desc.width.is_power_of_two() || !desc.height.is_power_of_two() { return 0; } ``` - **1920×1080 is non-power-of-two.** Standard display aspect ratios (1080p, 1440p, 4K, 720p, 21:9 ultrawide) used for loading artwork, video playback, and UI screens are non-power-of-two. - **3D streaming textures in RAGE / D3D12 BC mip chains are strictly power-of-two** (1024×1024, 2048×1024, 2048×2048, 4096×4096). - This keeps the 1920×1080 loading screen at 100% full quality (full 2.4–3.0 MB artwork captures, zero flat frames) while allowing all 1024/2048/4096 world textures to drop, **maintaining the full ~4.3 GiB saving (~7.0 GiB peak VRAM)**. 2. **Configurable Minimum Size Floor:** ```rust let min_size = crate::texture::texture_mip_drop_min_size(); // defaults to 1024 if desc.width < min_size || u64::from(desc.height) < min_size { return 0; } ``` - Defaults to `1024` (dropping 1024, 2048, and 4096 world textures, preserving utility/noise/LUT textures). - Testers who explicitly prefer your conservative mode can set `VICTORY_TEXTURE_MIP_DROP_MIN_SIZE=2048` to skip textures under 2048 on either axis.
antikohza commented 2026-11-24 16:05:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T15:50:17Z.


Great catch, @DrDarkDK. Excellent synthetic test case with the 512×512 4× MSAA source and 1024×1024 3-mip destination.

We have addressed this in commit 2df78b6 on feat/texture-mip-drop-budget (compare against main).

The Issue

While copy_texture_region remapped subresource indices via host_subresource(), list.rs::resolve was passing raw guest dst_sub and src_sub directly to the host D3D12 command list.

For your test case (1024×1024 destination with 3 mips and VICTORY_TEXTURE_MIP_DROP=1):

  • Guest mip 0 (1024×1024) is dropped.
  • Guest mip 1 (512×512) corresponds to host mip 0.
  • Guest mip 2 (256×256) corresponds to host mip 1.

Passing raw dst_sub = 1 targeted host mip 1 (256×256), creating an invalid dimension mismatch when resolving the 512×512 MSAA source.

The Fix

  1. Subresource Index Remapping & Dead-Mip Pruning (crates/victory-gpu/src/list.rs):
    Both dst_sub and src_sub are now remapped through host_subresource():

    let dst_sub = if let Some(hd) = crate::resource::host_copy(dst) {
        let Some(mapped) = hd.host_subresource(dst_sub) else {
            return; // Target mip was dropped; prune dead resolve
        };
        mapped
    } else {
        dst_sub
    };
    let src_sub = if let Some(hs) = crate::resource::host_copy(src) {
        let Some(mapped) = hs.host_subresource(src_sub) else {
            return;
        };
        mapped
    } else {
        src_sub
    };
    
    • In your test: guest destination mip 1 (dst_sub = 1) now maps directly to host mip 0 (dst_sub = 0).
    • If a resolve targets a dropped guest mip (e.g. guest mip 0), it early returns, discarding the dead resolve.
  2. Per-Mip Subresource Dimension Matching:
    Subresource dimensions are now computed per mip level ((a.Width >> dst_mip, a.Height >> dst_mip)) rather than comparing base resource mip 0:

    let dst_mips = u32::from(a.MipLevels).max(1);
    let src_mips = u32::from(b.MipLevels).max(1);
    let dst_mip = dst_sub % dst_mips;
    let src_mip = src_sub % src_mips;
    let dst_w = (a.Width >> dst_mip).max(1);
    let dst_h = (u64::from(a.Height) >> dst_mip).max(1);
    let src_w = (b.Width >> src_mip).max(1);
    let src_h = (u64::from(b.Height) >> src_mip).max(1);
    if (dst_w, dst_h) == (src_w, src_h) {
        list.list
            .ResolveSubresource(to, dst_sub, from, src_sub, format);
    } else if let Ok(list1) = list.list.cast::<ID3D12GraphicsCommandList1>() {
        let rect = RECT {
            left: 0,
            top: 0,
            right: dst_w.min(src_w) as i32,
            bottom: dst_h.min(src_h) as i32,
        };
        list1.ResolveSubresourceRegion(to, dst_sub, 0, 0, from, src_sub, Some(&rect), format, D3D12_RESOLVE_MODE_AVERAGE);
    }
    
    • For your test case: host destination mip 0 (512×512) matches the 512×512 MSAA source 1:1, invoking ResolveSubresource(to, 0, from, 0, format) cleanly on hardware and WARP.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7136696699 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7136696699). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T15:50:17Z. --- Great catch, @DrDarkDK. Excellent synthetic test case with the 512×512 4× MSAA source and 1024×1024 3-mip destination. We have addressed this in commit [`2df78b6`](https://github.com/antikohza/VIctory/commit/2df78b69db82e23e94e0e25845f788233fac635a) on `feat/texture-mip-drop-budget` ([compare against main](https://github.com/antikohza/VIctory/compare/ffe310e...feat/texture-mip-drop-budget)). ### The Issue While `copy_texture_region` remapped subresource indices via `host_subresource()`, `list.rs::resolve` was passing raw guest `dst_sub` and `src_sub` directly to the host D3D12 command list. For your test case (1024×1024 destination with 3 mips and `VICTORY_TEXTURE_MIP_DROP=1`): - Guest mip 0 (1024×1024) is dropped. - Guest mip 1 (512×512) corresponds to **host mip 0**. - Guest mip 2 (256×256) corresponds to **host mip 1**. Passing raw `dst_sub = 1` targeted host mip 1 (256×256), creating an invalid dimension mismatch when resolving the 512×512 MSAA source. ### The Fix 1. **Subresource Index Remapping & Dead-Mip Pruning (`crates/victory-gpu/src/list.rs`):** Both `dst_sub` and `src_sub` are now remapped through `host_subresource()`: ```rust let dst_sub = if let Some(hd) = crate::resource::host_copy(dst) { let Some(mapped) = hd.host_subresource(dst_sub) else { return; // Target mip was dropped; prune dead resolve }; mapped } else { dst_sub }; let src_sub = if let Some(hs) = crate::resource::host_copy(src) { let Some(mapped) = hs.host_subresource(src_sub) else { return; }; mapped } else { src_sub }; ``` - In your test: guest destination mip 1 (`dst_sub = 1`) now maps directly to **host mip 0 (`dst_sub = 0`)**. - If a resolve targets a dropped guest mip (e.g. guest mip 0), it early returns, discarding the dead resolve. 2. **Per-Mip Subresource Dimension Matching:** Subresource dimensions are now computed per mip level (`(a.Width >> dst_mip, a.Height >> dst_mip)`) rather than comparing base resource mip 0: ```rust let dst_mips = u32::from(a.MipLevels).max(1); let src_mips = u32::from(b.MipLevels).max(1); let dst_mip = dst_sub % dst_mips; let src_mip = src_sub % src_mips; let dst_w = (a.Width >> dst_mip).max(1); let dst_h = (u64::from(a.Height) >> dst_mip).max(1); let src_w = (b.Width >> src_mip).max(1); let src_h = (u64::from(b.Height) >> src_mip).max(1); if (dst_w, dst_h) == (src_w, src_h) { list.list .ResolveSubresource(to, dst_sub, from, src_sub, format); } else if let Ok(list1) = list.list.cast::<ID3D12GraphicsCommandList1>() { let rect = RECT { left: 0, top: 0, right: dst_w.min(src_w) as i32, bottom: dst_h.min(src_h) as i32, }; list1.ResolveSubresourceRegion(to, dst_sub, 0, 0, from, src_sub, Some(&rect), format, D3D12_RESOLVE_MODE_AVERAGE); } ``` - For your test case: host destination mip 0 (512×512) matches the 512×512 MSAA source 1:1, invoking `ResolveSubresource(to, 0, from, 0, format)` cleanly on hardware and WARP.
DrDarkDK commented 2026-11-24 16:05:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by DrDarkDK on 2026-11-24T15:56:58Z.


Retested 2df78b6 on native Windows with the RTX 4070 Ti and WARP. I submitted the original 512×512 4× MSAA resolve into guest mip 1 and read back all 262,144 pixels. Every pixel matched on both backends, with mip dropping off (host mip 1) and on (host mip 0).

With mip dropping on, I then cleared the source to a different color and resolved into dropped guest mip 0. The retained host mip kept the original color on both backends.

Synthetic test only. No title run.

AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7136879419 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7136879419). Originally posted by [DrDarkDK](https://github.com/DrDarkDK) on 2026-11-24T15:56:58Z. --- Retested `2df78b6` on native Windows with the RTX 4070 Ti and WARP. I submitted the original 512×512 4× MSAA resolve into guest mip 1 and read back all 262,144 pixels. Every pixel matched on both backends, with mip dropping off (host mip 1) and on (host mip 0). With mip dropping on, I then cleared the source to a different color and resolved into dropped guest mip 0. The retained host mip kept the original color on both backends. Synthetic test only. No title run. *AI-assisted with Codex.*
Logan-Gaillard commented 2026-11-24 17:04:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Logan-Gaillard on 2026-11-24T16:32:12Z.


Tested in-game on an 8 GB laptop GPU where main cannot reach the world at all. With
VICTORY_TEXTURE_MIP_DROP=1 on this branch, the world loads and runs.

Machine: RTX 5070 Laptop (8 GB VRAM), 15.4 GB RAM, 24.8 GB system-managed pagefile,
retail 1.0.2.1 on SSD, Windows 11. Build: feat/texture-mip-drop-budget at 06603c7,
release profile, built with cargo-xwin.

Without the switch (and on every build I tried: ffe310e, #1133, #472, #561) the run
stops at the same place: 79 packs opened, then host texture creation fails on ordinary
textures —

WARN victory_gpu::resource: no host texture error=E_OUTOFMEMORY (0x8007000E)
     desc=ResourceDesc { dimension: 3, width: 2048, height: 2048, mip_levels: 10, format: 71 ... }
WARN victory_gpu::resource: no host texture ... 1024x1024 mip_levels: 9, format: 98
ERROR victory_gpu::host: a host command list did not close (0x8007000E)
VIctory: host GPU failure: ... device removed

With VICTORY_TEXTURE_MIP_DROP=1 on this branch:

without switch with switch
packs opened 79 79
no host texture failures 40+ 0
command list did not close yes no
device removed yes no
world never reached loads
frame rate in the world — 29-30 fps, 34.4 ms/frame, 11 draws/frame
menus 30.0 fps / 33.3 ms 30.0 fps / 33.3 ms (unchanged)

Two details that may matter for the design:

  • nvidia-smi reported at most 501 MiB of VRAM in use during the failing load, and the
    process peaked at 15.6 GB private on a 15.4 GB machine. So the E_OUTOFMEMORY is not
    a simple "VRAM is full" reservation failure; the committed size of the host textures is
    what the driver refuses.
  • The failed textures are small and ordinary (BC1/BC3/BC7, 1024-2048 px, 9-12 mips), which
    is why a mip drop of 1 removes the failure entirely instead of just delaying it.

Suggestion for merge: keep the opt-in switch, but consider enabling 1 by default when the
adapter reports <= 8 GB, since on that class of GPU the unpatched build cannot reach the
world at all.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137818516 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7137818516). Originally posted by [Logan-Gaillard](https://github.com/Logan-Gaillard) on 2026-11-24T16:32:12Z. --- Tested in-game on an 8 GB laptop GPU where `main` cannot reach the world at all. With `VICTORY_TEXTURE_MIP_DROP=1` on this branch, the world loads and runs. **Machine**: RTX 5070 Laptop (8 GB VRAM), 15.4 GB RAM, 24.8 GB system-managed pagefile, retail 1.0.2.1 on SSD, Windows 11. Build: `feat/texture-mip-drop-budget` at `06603c7`, release profile, built with `cargo-xwin`. **Without the switch** (and on every build I tried: `ffe310e`, #1133, #472, #561) the run stops at the same place: 79 packs opened, then host texture creation fails on ordinary textures — ``` WARN victory_gpu::resource: no host texture error=E_OUTOFMEMORY (0x8007000E) desc=ResourceDesc { dimension: 3, width: 2048, height: 2048, mip_levels: 10, format: 71 ... } WARN victory_gpu::resource: no host texture ... 1024x1024 mip_levels: 9, format: 98 ERROR victory_gpu::host: a host command list did not close (0x8007000E) VIctory: host GPU failure: ... device removed ``` **With `VICTORY_TEXTURE_MIP_DROP=1` on this branch**: | | without switch | with switch | | --- | --- | --- | | packs opened | 79 | 79 | | `no host texture` failures | 40+ | **0** | | `command list did not close` | yes | **no** | | device removed | yes | **no** | | world | never reached | **loads** | | frame rate in the world | — | **29-30 fps, 34.4 ms/frame, 11 draws/frame** | | menus | 30.0 fps / 33.3 ms | 30.0 fps / 33.3 ms (unchanged) | Two details that may matter for the design: - nvidia-smi reported at most **501 MiB** of VRAM in use during the failing load, and the process peaked at **15.6 GB private** on a 15.4 GB machine. So the `E_OUTOFMEMORY` is not a simple "VRAM is full" reservation failure; the committed size of the host textures is what the driver refuses. - The failed textures are small and ordinary (BC1/BC3/BC7, 1024-2048 px, 9-12 mips), which is why a mip drop of 1 removes the failure entirely instead of just delaying it. Suggestion for merge: keep the opt-in switch, but consider enabling `1` by default when the adapter reports <= 8 GB, since on that class of GPU the unpatched build cannot reach the world at all.
antikohza commented 2026-11-24 18:05:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T17:08:00Z.


@Logan-Gaillard Thank you for the detailed hardware profiling and diagnostics! The distinction you highlighted between resident physical VRAM (501 MiB) and private committed virtual memory saturation (15.6 GB on a 15.4 GB system) during the 79-pack loading burst explains exactly why unpatched main hits 0x8007000E (E_OUTOFMEMORY) inside WDDM host resource creation.

Your suggestion has been implemented on branch feat/texture-mip-drop-budget (commit 4dd48bd):

  1. DXGI VRAM Probing:
    When VICTORY_TEXTURE_MIP_DROP is not explicitly set in the environment, the engine queries the discrete DXGI adapter's DedicatedVideoMemory (IDXGIFactory4::EnumAdapters1).

  2. Auto-Default for \le 8 GB GPUs:
    If primary discrete VRAM is \le 8.5 GiB (covering 4 GB, 6 GB, and 8 GB cards like your RTX 5070 Laptop, RTX 4060, RX 6600, etc.), it automatically defaults to drop = 1 out of the box so the open world loads cleanly without requiring manual environment variable configuration.

  3. High-Memory Preservation & Explicit Overrides:

    • Systems with \ge 10 GB VRAM default to 0 (native full resolution).
    • Explicit environment variables (VICTORY_TEXTURE_MIP_DROP=0 to force full quality, or 2 for aggressive budgeting) continue to take priority over the auto-detected default.

All CI checks (clippy and workspace unit tests) are green.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7138734702 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7138734702). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T17:08:00Z. --- @Logan-Gaillard Thank you for the detailed hardware profiling and diagnostics! The distinction you highlighted between resident physical VRAM (501 MiB) and private committed virtual memory saturation (15.6 GB on a 15.4 GB system) during the 79-pack loading burst explains exactly why unpatched `main` hits `0x8007000E (E_OUTOFMEMORY)` inside WDDM host resource creation. Your suggestion has been implemented on branch `feat/texture-mip-drop-budget` (commit [`4dd48bd`](https://github.com/antikohza/VIctory/commit/4dd48bdc5496250cfb01404021c34d4547ffcd93)): 1. **DXGI VRAM Probing**: When `VICTORY_TEXTURE_MIP_DROP` is not explicitly set in the environment, the engine queries the discrete DXGI adapter's `DedicatedVideoMemory` (`IDXGIFactory4::EnumAdapters1`). 2. **Auto-Default for $\le$ 8 GB GPUs**: If primary discrete VRAM is $\le$ 8.5 GiB (covering 4 GB, 6 GB, and 8 GB cards like your RTX 5070 Laptop, RTX 4060, RX 6600, etc.), it automatically defaults to `drop = 1` out of the box so the open world loads cleanly without requiring manual environment variable configuration. 3. **High-Memory Preservation & Explicit Overrides**: - Systems with $\ge$ 10 GB VRAM default to `0` (native full resolution). - Explicit environment variables (`VICTORY_TEXTURE_MIP_DROP=0` to force full quality, or `2` for aggressive budgeting) continue to take priority over the auto-detected default. All CI checks (clippy and workspace unit tests) are green.
Logan-Gaillard commented 2026-11-24 18:05:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Logan-Gaillard on 2026-11-24T17:18:16Z.


Tested 4dd48bd in-game today on the same machine, in both adapter configurations.

Machine: RTX 5070 Laptop (DedicatedVideoMemory = 8,273,264,640) + an Intel iGPU, 15.4 GB RAM,
24.8 GB pagefile, retail 1.0.2.1 from SSD, Windows 11.

1. Default adapter (what a user actually gets). The device comes from
D3D12CreateDevice(None, ...), which on this laptop is the Intel iGPU:

host adapter adapter=Intel(R) Graphics
host device memory bytes=134217728      (128 MiB dedicated)

Your probe returns the maximum DedicatedVideoMemory over the adapters, i.e. the RTX's
8,273,264,640, so it auto-enables drop = 1 — for a device that is not running on that card. The
run still dies at world load:

ERROR host GPU device removed after a submission of 1 lists ... (0x887A0004)
ERROR a host command list did not close (0x887A0005 device paused)

2. Device forced onto the RTX (per-app Windows GPU preference for the exe): auto drop = 1,
and the load gets much further — world streaming at 0.5-1.1 fps, 165-289 MB of copies and
93-136 MB of textures per frame, GPU 245-1219 ms — then:

ERROR host GPU device removed after a submission of 11 lists (0x887A0004)

So the auto-default is the right idea and it removes the whole E_OUTOFMEMORY class, but two
things follow from the runs:

  • The probe should measure the adapter the device was created on, not the best one.
    device.GetAdapterLuid() matched against IDXGIAdapter1::GetDesc1().AdapterLuid gives that.
    Otherwise a laptop whose default is its iGPU computes the budget from a card it never uses —
    and a 12 GB laptop with an iGPU default would stay at drop = 0 while its host copies live in
    shared system memory, which is the case this switch exists for.
  • Even on the right adapter, world streaming still removes the device on this machine with no
    allocation failure logged. That residual fault is #653 and it is independent of texture size;
    the mip drop is necessary but not sufficient here.

My own version of the same idea (LUID-matched size, plus creating the device on the adapter with
the most dedicated memory) is on a local branch fix/auto-mip-drop-on-oom (1cfd8ed, 2cbc63c)
because this account has no write access here (#717) — happy to hand the diff over if a branch is
created.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7138992525 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7138992525). Originally posted by [Logan-Gaillard](https://github.com/Logan-Gaillard) on 2026-11-24T17:18:16Z. --- Tested `4dd48bd` in-game today on the same machine, in both adapter configurations. **Machine**: RTX 5070 Laptop (`DedicatedVideoMemory` = 8,273,264,640) + an Intel iGPU, 15.4 GB RAM, 24.8 GB pagefile, retail 1.0.2.1 from SSD, Windows 11. **1. Default adapter (what a user actually gets).** The device comes from `D3D12CreateDevice(None, ...)`, which on this laptop is the **Intel iGPU**: ``` host adapter adapter=Intel(R) Graphics host device memory bytes=134217728 (128 MiB dedicated) ``` Your probe returns the *maximum* `DedicatedVideoMemory` over the adapters, i.e. the RTX's 8,273,264,640, so it auto-enables `drop = 1` — for a device that is not running on that card. The run still dies at world load: ``` ERROR host GPU device removed after a submission of 1 lists ... (0x887A0004) ERROR a host command list did not close (0x887A0005 device paused) ``` **2. Device forced onto the RTX** (per-app Windows GPU preference for the exe): auto `drop = 1`, and the load gets much further — world streaming at 0.5-1.1 fps, 165-289 MB of copies and 93-136 MB of textures per frame, GPU 245-1219 ms — then: ``` ERROR host GPU device removed after a submission of 11 lists (0x887A0004) ``` So the auto-default is the right idea and it removes the whole `E_OUTOFMEMORY` class, but two things follow from the runs: - **The probe should measure the adapter the device was created on**, not the best one. `device.GetAdapterLuid()` matched against `IDXGIAdapter1::GetDesc1().AdapterLuid` gives that. Otherwise a laptop whose default is its iGPU computes the budget from a card it never uses — and a 12 GB laptop with an iGPU default would stay at `drop = 0` while its host copies live in shared system memory, which is the case this switch exists for. - Even on the right adapter, world streaming still removes the device on this machine with no allocation failure logged. That residual fault is #653 and it is independent of texture size; the mip drop is necessary but not sufficient here. My own version of the same idea (LUID-matched size, plus creating the device on the adapter with the most dedicated memory) is on a local branch `fix/auto-mip-drop-on-oom` (`1cfd8ed`, `2cbc63c`) because this account has no write access here (#717) — happy to hand the diff over if a branch is created.
antikohza commented 2026-11-24 18:05:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T17:29:07Z.


@Logan-Gaillard That would be awesome. The goal is to make sure everyone with a low-VRAM or hybrid laptop can just boot up and run the game without hitting roadblocks.

Please share your diff or commit patch (paste it here or link a gist/branch) and I will merge it directly into PR #1296 so hybrid laptop users get discrete GPU selection and LUID-matched auto-drop out of the box!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139264627 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7139264627). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T17:29:07Z. --- @Logan-Gaillard That would be awesome. The goal is to make sure everyone with a low-VRAM or hybrid laptop can just boot up and run the game without hitting roadblocks. Please share your diff or commit patch (paste it here or link a gist/branch) and I will merge it directly into PR #1296 so hybrid laptop users get discrete GPU selection and LUID-matched auto-drop out of the box!
ghmfreitas commented 2026-11-24 19:04:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by ghmfreitas on 2026-11-24T18:29:14Z.


8 GB NVIDIA laptop on Linux/Proton: with and without the drop, and the auto-default on 4dd48bd

Setup: RTX 3070 Laptop (8 GB) plus an Intel iGPU, i7-11800H, 31 GB RAM, Linux 7.0, NVIDIA 595.99.02, Proton 11.0 (wine-11.0) with vkd3d-proton 3.2.0, Series X, 1.0.2.1. Diagnostics build cross-compiled for x86_64-pc-windows-msvc: ffe310e + #177 + #259 + this branch at the head shown. GPU memory is nvidia-smi's total, sampled every 5 s (79 MiB before the title starts). "World streaming" below means pacing lines with 200 or more draws per frame.

branch head VICTORY_TEXTURE_MIP_DROP runs lowest free RAM peak GPU memory NV_ERR_NO_MEMORY lines in the kernel log how it ended
4c84a09 unset 1 not recorded; the machine was short 7,840 MiB 8 crash 5 min 22 s in: exception inside vkAllocateMemory; 31 shaders translated, no world frame
4dd48bd 0 1 8.3 GB 7,843 MiB 13 my 480 s limit; world streaming from 4 min 20 s after the story load began
4c84a09 1 2 2.8 / 10.1 GB 6,756 / 6,782 MiB 0 my 900 s limit, both; world streaming from 4 min 55 s / 4 min 23 s
4dd48bd unset 1 9.7 GB 6,664 MiB 0 my 480 s limit; world streaming from 4 min 33 s

What I read from it:

  • The drop is worth about 1.1 GB of GPU memory here (7.84 GB down to 6.66–6.78 GB), and with it the driver stops logging allocation failures.
  • It is not what decides whether the world loads on this machine. With RAM to spare, =0 reached world streaming too, with the card pinned at 7,843 MiB. The one crash I have without the drop came when the machine was also short of RAM, so I can't put it on VRAM alone. That differs from #1226, where VRAM sat at 501 MiB and commit ran out.
  • Auto-default on a hybrid laptop under Proton: with the variable unset, 4dd48bd logged auto-enabling VICTORY_TEXTURE_MIP_DROP=1 for <= 8 GB GPU vram_mb=8160. The device was on the RTX (it is the card whose memory fills), so the largest-adapter probe gave the right answer on this box. I did not check which adapters DXGI lists under Proton, so this says nothing about the iGPU-default case @Logan-Gaillard measured on Windows. An explicit =0 overrides it: no auto-enabling line, and the card is back at 7,843 MiB.
  • No E_OUTOFMEMORY in any of the five logs. The only no host texture lines are two E_INVALIDARG on 2560×1440 textures (formats 86 and 115), the same with and without the drop. That is #797.
  • World pacing doesn't move with the drop. Median 9.8 s per frame with =0 (12 pacing lines), 11.7 s on auto (10 lines), 10.5 s and 12.0 s in the two 900 s runs (35 and 36 lines). GPU time is 0.14–0.97 s of each frame; the rest is CPU-side copies (#834). The world picture is near-black: one capture, 4dd48bd on auto, brightest pixel 2 of 255.

Not tested: drop 2 or 3; VICTORY_TEXTURE_MIP_DROP_MIN_SIZE; =0 past 480 s; a capture with =0, so nothing here says whether the drop changes the picture; loading artwork with the drop on; Windows.

AI use: Claude Code ran the title and wrote this; counts and offsets only, no game data attached.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140712884 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7140712884). Originally posted by [ghmfreitas](https://github.com/ghmfreitas) on 2026-11-24T18:29:14Z. --- **8 GB NVIDIA laptop on Linux/Proton: with and without the drop, and the auto-default on `4dd48bd`** **Setup:** RTX 3070 Laptop (8 GB) plus an Intel iGPU, i7-11800H, 31 GB RAM, Linux 7.0, NVIDIA 595.99.02, Proton 11.0 (wine-11.0) with vkd3d-proton 3.2.0, Series X, 1.0.2.1. Diagnostics build cross-compiled for `x86_64-pc-windows-msvc`: `ffe310e` + #177 + #259 + this branch at the head shown. GPU memory is `nvidia-smi`'s total, sampled every 5 s (79 MiB before the title starts). "World streaming" below means pacing lines with 200 or more draws per frame. | branch head | `VICTORY_TEXTURE_MIP_DROP` | runs | lowest free RAM | peak GPU memory | `NV_ERR_NO_MEMORY` lines in the kernel log | how it ended | |---|---|---|---|---|---|---| | `4c84a09` | unset | 1 | not recorded; the machine was short | 7,840 MiB | 8 | crash 5 min 22 s in: exception inside `vkAllocateMemory`; 31 shaders translated, no world frame | | `4dd48bd` | `0` | 1 | 8.3 GB | 7,843 MiB | 13 | my 480 s limit; world streaming from 4 min 20 s after the story load began | | `4c84a09` | `1` | 2 | 2.8 / 10.1 GB | 6,756 / 6,782 MiB | 0 | my 900 s limit, both; world streaming from 4 min 55 s / 4 min 23 s | | `4dd48bd` | unset | 1 | 9.7 GB | 6,664 MiB | 0 | my 480 s limit; world streaming from 4 min 33 s | What I read from it: - **The drop is worth about 1.1 GB of GPU memory here** (7.84 GB down to 6.66–6.78 GB), and with it the driver stops logging allocation failures. - **It is not what decides whether the world loads on this machine.** With RAM to spare, `=0` reached world streaming too, with the card pinned at 7,843 MiB. The one crash I have without the drop came when the machine was also short of RAM, so I can't put it on VRAM alone. That differs from #1226, where VRAM sat at 501 MiB and commit ran out. - **Auto-default on a hybrid laptop under Proton:** with the variable unset, `4dd48bd` logged `auto-enabling VICTORY_TEXTURE_MIP_DROP=1 for <= 8 GB GPU vram_mb=8160`. The device was on the RTX (it is the card whose memory fills), so the largest-adapter probe gave the right answer on this box. I did not check which adapters DXGI lists under Proton, so this says nothing about the iGPU-default case @Logan-Gaillard measured on Windows. An explicit `=0` overrides it: no `auto-enabling` line, and the card is back at 7,843 MiB. - No `E_OUTOFMEMORY` in any of the five logs. The only `no host texture` lines are two `E_INVALIDARG` on 2560×1440 textures (formats 86 and 115), the same with and without the drop. That is #797. - **World pacing doesn't move with the drop.** Median 9.8 s per frame with `=0` (12 pacing lines), 11.7 s on auto (10 lines), 10.5 s and 12.0 s in the two 900 s runs (35 and 36 lines). GPU time is 0.14–0.97 s of each frame; the rest is CPU-side copies (#834). The world picture is near-black: one capture, `4dd48bd` on auto, brightest pixel 2 of 255. **Not tested:** drop 2 or 3; `VICTORY_TEXTURE_MIP_DROP_MIN_SIZE`; `=0` past 480 s; a capture with `=0`, so nothing here says whether the drop changes the picture; loading artwork with the drop on; Windows. AI use: Claude Code ran the title and wrote this; counts and offsets only, no game data attached.
antikohza commented 2026-11-24 19:04:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T18:36:50Z.


@ghmfreitas Thank you for the thorough Linux/Proton and vkd3d-proton benchmarking!

Seeing peak VRAM drop by ~1.18 GB (7,843 MiB down to 6,664 MiB) and kernel NV_ERR_NO_MEMORY lines drop from 13 down to 0 confirms that the mip-drop architecture stabilizes Vulkan memory allocations under Wine/vkd3d just as effectively as D3D12 on native Windows. It's also great to see the DXGI VRAM probe auto-enabling cleanly across the Proton translation layer without manual intervention.

For tracking, the official PR has been submitted upstream as #1296: https://github.com/Marvisak/VIctory/pull/1296

If you're in contact with other testers on Linux, Steam Deck, or different low-VRAM configurations (such as 6 GB laptop GPUs or AMD RDNA cards), feel free to invite them to test PR #1296 and share their telemetry—the more diverse hardware we verify, the faster upstream can merge!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140890788 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7140890788). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T18:36:50Z. --- @ghmfreitas Thank you for the thorough Linux/Proton and vkd3d-proton benchmarking! Seeing peak VRAM drop by ~1.18 GB (7,843 MiB down to 6,664 MiB) and kernel `NV_ERR_NO_MEMORY` lines drop from 13 down to 0 confirms that the mip-drop architecture stabilizes Vulkan memory allocations under Wine/vkd3d just as effectively as D3D12 on native Windows. It's also great to see the DXGI VRAM probe auto-enabling cleanly across the Proton translation layer without manual intervention. For tracking, the official PR has been submitted upstream as #1296: https://github.com/Marvisak/VIctory/pull/1296 If you're in contact with other testers on Linux, Steam Deck, or different low-VRAM configurations (such as 6 GB laptop GPUs or AMD RDNA cards), feel free to invite them to test PR #1296 and share their telemetry—the more diverse hardware we verify, the faster upstream can merge!
antikohza commented 2026-11-24 20:03:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-24T19:58:54Z.


@ghmfreitas @bittertea0323 @DrDarkDK @MichaelSmithAI — thank you for all the testing and reviews on #737 and #1086. All follow-up issues from this thread are now resolved in #1296 (a6f3ccb, Windows CI run 45470890213) and stacked cleanly on #1542 in feat/texture-mip-drop-on-1542 (0d79788, CI run 45473319819):

  • descriptor/host.rs: adjust_srv_window() now also shifts ResourceMinLODClamp, clamps out-of-range views (most_detailed >= drop + host_mips), and adds unit coverage.
  • list.rs & texture.rs: copy_resource across mismatched mip_drop now safely copies overlapping surviving subresources instead of skipping, and resolve / copy_texture_region mark only the target subresource (HostWritten u128 bitmask) so untouched upper mips still upload.
  • resource.rs & host.rs: Single drop computation in host_texture(), BCn 4×4 alignment guard for custom VICTORY_TEXTURE_MIP_DROP_MIN_SIZE, and D3D_FEATURE_LEVEL_12_0 probing in best_adapter().

If anyone has a chance to re-test a6f3ccb (or 0d79788 with lazy textures) — especially =0 vs =1 picture captures or drop=2/MIN_SIZE on 6–8 GB setups — feedback on #1296 is always welcome.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7142874665 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7142874665). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-24T19:58:54Z. --- @ghmfreitas @bittertea0323 @DrDarkDK @MichaelSmithAI — thank you for all the testing and reviews on #737 and #1086. All follow-up issues from this thread are now resolved in **#1296** (`a6f3ccb`, [Windows CI run 45470890213](https://github.com/antikohza/VIctory/actions/runs/45470890213)) and stacked cleanly on **#1542** in [`feat/texture-mip-drop-on-1542`](https://github.com/antikohza/VIctory/tree/feat/texture-mip-drop-on-1542) (`0d79788`, [CI run 45473319819](https://github.com/antikohza/VIctory/actions/runs/45473319819)): - **`descriptor/host.rs`:** `adjust_srv_window()` now also shifts `ResourceMinLODClamp`, clamps out-of-range views (`most_detailed >= drop + host_mips`), and adds unit coverage. - **`list.rs` & `texture.rs`:** `copy_resource` across mismatched `mip_drop` now safely copies overlapping surviving subresources instead of skipping, and `resolve` / `copy_texture_region` mark only the target subresource (`HostWritten` `u128` bitmask) so untouched upper mips still upload. - **`resource.rs` & `host.rs`:** Single `drop` computation in `host_texture()`, BCn 4×4 alignment guard for custom `VICTORY_TEXTURE_MIP_DROP_MIN_SIZE`, and `D3D_FEATURE_LEVEL_12_0` probing in `best_adapter()`. If anyone has a chance to re-test `a6f3ccb` (or `0d79788` with lazy textures) — especially `=0` vs `=1` picture captures or `drop=2`/`MIN_SIZE` on 6–8 GB setups — feedback on #1296 is always welcome.
Marvisak commented 2026-11-25 02:06:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:49:49Z.


Automated triage for the maintainers.

The switch is now in an open pull request, #2146, rebased on main at 940d32f; thank you for opening it. main itself still has no texture mip drop (no VICTORY_TEXTURE_MIP_DROP in the tree). Note that #2146 also brings in a DXGI adapter-selection change, which reviewers may prefer as a separate PR.

Open PR #1272 (ESAT586) carries the same idea plus an automatic drop on E_OUTOFMEMORY; it may be simpler to review one of the two. #1226 and #1086 are the out-of-memory reports this addresses.

Scope: an opt-in quality/memory switch for Windows hosts running this title fits the project. Whether to take it, and whether it should turn on by itself on cards with 8 GB or less, is for the maintainers.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150005950 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7150005950). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:49:49Z. --- <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-25T06:03:53Z at=2026-11-25T06:57:57Z --> Automated triage for the maintainers. The switch is now in an open pull request, #2146, rebased on `main` at `940d32f`; thank you for opening it. `main` itself still has no texture mip drop (no `VICTORY_TEXTURE_MIP_DROP` in the tree). Note that #2146 also brings in a DXGI adapter-selection change, which reviewers may prefer as a separate PR. Open PR #1272 (ESAT586) carries the same idea plus an automatic drop on `E_OUTOFMEMORY`; it may be simpler to review one of the two. #1226 and #1086 are the out-of-memory reports this addresses. Scope: an opt-in quality/memory switch for Windows hosts running this title fits the project. Whether to take it, and whether it should turn on by itself on cards with 8 GB or less, is for the maintainers. --- _Generated by [Claude Code](https://claude.ai/code)_
antikohza commented 2026-11-25 07:03:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by antikohza on 2026-11-25T06:03:53Z.


Opened a fresh rebased PR against current main (940d32f) per triage guidance: https://github.com/Marvisak/VIctory/pull/2146

Updates in this rebase:

  • Reconciled cleanly with main's shared HostTexture (13bbd6f), upload_changed, and subresource_len bounds clamping.
  • Applied @ericomeehan's DXGI improvements (IDXGIFactory6::EnumAdapterByGpuPreference(HIGH_PERFORMANCE) + null-device FL12 probe).
  • Moved HostWritten per-subresource tracking directly onto HostTexture.
  • Verified green on Windows MSVC 1.98.1 (CI run 45557329026: Clippy clean, victory-gpu 149 passed, workspace 707 passed).
<!-- greyfinch-sync:Marvisak/VIctory:comment:7154403962 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/737#issuecomment-7154403962). Originally posted by [antikohza](https://github.com/antikohza) on 2026-11-25T06:03:53Z. --- Opened a fresh rebased PR against current `main` (`940d32f`) per triage guidance: https://github.com/Marvisak/VIctory/pull/2146 Updates in this rebase: - Reconciled cleanly with `main`'s shared `HostTexture` (`13bbd6f`), `upload_changed`, and `subresource_len` bounds clamping. - Applied `@ericomeehan`'s DXGI improvements (`IDXGIFactory6::EnumAdapterByGpuPreference(HIGH_PERFORMANCE)` + null-device FL12 probe). - Moved `HostWritten` per-subresource tracking directly onto `HostTexture`. - Verified green on Windows MSVC `1.98.1` ([CI run 45557329026](https://github.com/antikohza/VIctory/actions/runs/45557329026): Clippy clean, `victory-gpu` 149 passed, workspace 707 passed).
Sign in to join this conversation.
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
Marvisak/VIctory#737
No description provided.