Textures: VICTORY_DROP_MIPS leaves a placed texture's largest levels out #4785

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

@⁠andreasposchinger-dotcom on GitHub · 2026-12-01 08:13 UTC · original
andreasposchinger-dotcom:vibe/drop-texture-mips-cd2fb7 → main · +170 −13 · 5 files · 1 commits · draft

Fixes #3786

What it changes

With VICTORY_DROP_MIPS set (the F1 menu's MEMORY > DROP TEXTURE MIPS), a view of a placed texture shows from the level that is left: the texture's largest levels are left out, on the card and in its host copy. Less memory and fewer uploads; the picture is softer up close.

  • first_mip takes the resource's description with the view's: the level a slot shows is the largest the texture drops that the view still shows.
  • A view the host makes of a placed texture starts at that level too (drop_view, taken before the copy base is read).
  • A view the title placed of a texture it fills itself starts there as well (first_mip_of).
  • VICTORY_DROP_MIPS is off by default (0): a texture keeps its levels, as before. The issue's patch turned it to 2; on, the picture is softer up close, so it asks to be chosen. So is a value from 1 to 4; more than the texture's last level is clipped to it.
  • Also in F1: MEMORY > DROP TEXTURE MIPS, and a row in the README's Textures table.

How it was tested

  • GPU and profile: none. A Windows build and the game could not be run here.
  • cargo check -p victory-gpu --target x86_64-pc-windows-msvc passed for the lib with tests (mimalloc's and blake3's C stood in for locally; the stand-ins were not committed).
  • cargo clippy -p victory-gpu --target x86_64-pc-windows-msvc --lib --profile test -- -D warnings: the five lints it reports are pre-existing on main (host/font.rs 213 and 260, host/menu.rs 673, host/panel.rs 602 and 668). On main, clippy for this target cannot be run here at all (its build scripts fail), so this is as far as it goes locally; none of the five is in a file this touches.
  • A new drop_mips_leaves_the_largest_levels_out test runs in CI (the code is Windows-only); nothing was run here.
  • Not tested in the game: no card here. The issue's author measured it working on an RTX 2070 Super and a Series S profile with 2.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none found. Issue #3831's fix is already on main; this one has none.
**@⁠andreasposchinger-dotcom** on GitHub · 2026-12-01 08:13 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4784) `andreasposchinger-dotcom:vibe/drop-texture-mips-cd2fb7` → `main` · +170 −13 · 5 files · 1 commits · draft Fixes #3786 ## What it changes With `VICTORY_DROP_MIPS` set (the F1 menu's MEMORY > DROP TEXTURE MIPS), a view of a placed texture shows from the level that is left: the texture's largest levels are left out, on the card and in its host copy. Less memory and fewer uploads; the picture is softer up close. - `first_mip` takes the resource's description with the view's: the level a slot shows is the largest the texture drops that the view still shows. - A view the host makes of a placed texture starts at that level too (`drop_view`, taken before the copy base is read). - A view the title placed of a texture it fills itself starts there as well (`first_mip_of`). - `VICTORY_DROP_MIPS` is off by default (0): a texture keeps its levels, as before. The issue's patch turned it to 2; on, the picture is softer up close, so it asks to be chosen. So is a value from 1 to 4; more than the texture's last level is clipped to it. - Also in F1: MEMORY > DROP TEXTURE MIPS, and a row in the README's Textures table. ## How it was tested - GPU and profile: none. A Windows build and the game could not be run here. - `cargo check -p victory-gpu --target x86_64-pc-windows-msvc` passed for the lib with tests (mimalloc's and blake3's C stood in for locally; the stand-ins were not committed). - `cargo clippy -p victory-gpu --target x86_64-pc-windows-msvc --lib --profile test -- -D warnings`: the five lints it reports are pre-existing on `main` (`host/font.rs` 213 and 260, `host/menu.rs` 673, `host/panel.rs` 602 and 668). On `main`, clippy for this target cannot be run here at all (its build scripts fail), so this is as far as it goes locally; none of the five is in a file this touches. - A new `drop_mips_leaves_the_largest_levels_out` test runs in CI (the code is Windows-only); nothing was run here. - Not tested in the game: no card here. The issue's author measured it working on an RTX 2070 Super and a Series S profile with 2. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none found. Issue #3831's fix is already on `main`; this one has none.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 08:15:38 +00:00
Author
Owner

@⁠gut0to on GitHub · 2026-12-01 15:14 UTC · original · reviewed

AI-assisted review: I traced the new test through dropped() and the environment-backed drop_mips() setting. I used AI assistance and verified the default behavior in the current source.

**@⁠gut0to** on GitHub · 2026-12-01 15:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4784#pullrequestreview-6134134285) · **reviewed** AI-assisted review: I traced the new test through dropped() and the environment-backed drop_mips() setting. I used AI assistance and verified the default behavior in the current source.
@ -6285,0 +6383,4 @@
layout: 0,
flags: 0,
};
assert_eq!(dropped(&d, 0, u32::MAX), 2);
Author
Owner

@⁠gut0to on GitHub · 2026-12-01 15:14 UTC · original

This test depends on VICTORY_DROP_MIPS in the calling environment: dropped() reads drop_mips(), whose default is 0, while these assertions require 2. On a clean Windows test run with the variable unset, the first assertion returns 0 and fails; if a developer exports 2, the result becomes environment-dependent. Could the pure calculation take the requested mip count as an argument, with a separate test for environment parsing?

**@⁠gut0to** on GitHub · 2026-12-01 15:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4784#discussion_r4756296212) This test depends on VICTORY_DROP_MIPS in the calling environment: dropped() reads drop_mips(), whose default is 0, while these assertions require 2. On a clean Windows test run with the variable unset, the first assertion returns 0 and fails; if a developer exports 2, the result becomes environment-dependent. Could the pure calculation take the requested mip count as an argument, with a separate test for environment parsing?
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host/menu.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4784'
git switch 'github-bot/gh-4784'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4784'
git switch 'github-bot/gh-4784'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4784'
git switch 'main'
git merge --squash 'github-bot/gh-4784'
git switch 'main'
git merge --ff-only 'github-bot/gh-4784'
git switch 'main'
git merge 'github-bot/gh-4784'
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/trustno1-coder--VIctory-NVIDIA!4785
No description provided.