Skip to content

GPU: mip-drop large sampled textures on low-VRAM adapters - #19

Merged
devin-ai-integration[bot] merged 2 commits into
mainfrom
devin/1795581744-rx580-memory
Nov 25, 2026
Merged

devin-ai-integration[bot] merged 2 commits into
mainfrom
devin/1795581744-rx580-memory

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

RX 580 memory/VRAM wave, adapted from upstream Marvisak/VIctory#1272 plus the hardware findings in Marvisak/VIctory#1296, and integrated with this fork's newer separate staging/host-written texture state.

  • Select the hardware adapter with the most dedicated VRAM instead of blindly accepting DXGI's default, avoiding the Ryzen 4600G integrated GPU trap when an RX 580 is present.
  • Default pure sampled power-of-two textures to one dropped top mip on adapters with at most 8.5 GiB dedicated VRAM; VICTORY_TEXTURE_MIP_DROP=0..=3 overrides this.
  • Raise mip-drop pressure monotonically after E_OUTOFMEMORY and retry allocation where legal.
  • Exempt render targets, depth targets, UAVs, MSAA, non-power-of-two UI/artwork, small textures, and BC-misaligned extents. VICTORY_TEXTURE_MIP_DROP_MIN_SIZE defaults to 1024.
  • Rebase explicit SRV mip windows onto the surviving host mip chain; detile console mip host_mip + drop into the smaller staging allocation.
  • Remap or prune dropped subresources in texture copies, CopyResource, and resolves.
  • Use the console texture memory size for recheck fingerprints rather than the smaller staging allocation.

Upstream measured the mip-drop family as eliminating E_OUTOFMEMORY on 6-8 GB cards with about 1.1-1.2 GiB VRAM saved. This PR does not claim an FPS gain: upstream found frame pacing remains dominated by CPU-side copies. The expected RX 580 benefit is reaching/keeping world streaming within memory budget so other optimizations can matter.

Validation on this Linux VM: fmt, asset policy (186 files), Windows-target workspace check, and Windows-target all-features clippy with -D warnings. Not run with the title, real GPU, Windows, Wine/Proton, or game data here.

Link to Devin session: https://app.devin.ai/sessions/75bbf6b4192940fea34014b13a016bee
Open in Devin Desktop: https://app.devin.ai/desktop/session/75bbf6b4192940fea34014b13a016bee?variant=devin
Requested by: @Personed

Adapted from upstream Marvisak/VIctory#1272 and the hardware findings in #1296, integrated with this fork's separate staging/host-written texture state.

The host now chooses the hardware adapter with the most dedicated VRAM instead of blindly taking DXGI's default, records the selected adapter memory, and defaults pure sampled power-of-two textures to one dropped top mip on adapters with at most 8.5 GiB dedicated VRAM. VICTORY_TEXTURE_MIP_DROP overrides the baseline and allocation E_OUTOFMEMORY raises pressure monotonically, retrying with another surviving mip where legal. Render targets, depth targets, UAVs, MSAA, NPOT UI/artwork, small textures, and BC-misaligned extents are exempt.

Explicit SRV mip windows are rebased and clamped onto the surviving host chain; staging detiles console mip host_mip + drop; texture copies, CopyResource fallbacks, and resolves remap or prune dropped subresources. The host recheck fingerprint now uses the console texture memory size rather than the smaller staging allocation.

Validation on this Linux VM: fmt, policy, Windows-target workspace check and all-features clippy with -D warnings. No real GPU, game data, Windows, Wine/Proton, or retail-title run here.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot merged commit d06717b into main Nov 25, 2026
4 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/1795581744-rx580-memory branch November 25, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant