native: VICTORY_TEXTURE_DROP_TOP_MIP=2 also drops a second level of very large textures #469

Merged
Hayyan612 merged 1 commit from upstream-pr/469 into main 2026-11-28 00:38:42 +00:00
Hayyan612 commented 2026-11-27 21:35:57 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Hayyan612 on 2026-11-27T21:35:57Z.


What this changes

Follow-up to the top-mip drop (#348, merged): VICTORY_TEXTURE_DROP_TOP_MIP=2 also makes a sampled-only 2D texture whose larger side is at least 4096 texels, and that has two levels below its top, without its top two levels: a quarter of the width and height, about 94% of its memory. Textures from 1024 to 4095 still lose one level, a texture always keeps at least one, and =1 is unchanged. Off by default, like =1.

The upload, the background job, the view mapping (host_mip_range) and the copies (host_mip in 80a012f1, mip - dropped_levels()) already take any number of dropped levels; the selection now takes the setting's level instead of a flag. Docs: docs/native-host.md and docs/metal-backend.md.

Refs #347

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory: not run; the change is in victory-gpu only. Ran natively on arm64 instead: cargo test -p victory-gpu --lib -- drop_top_mip a_texture_made_without host_mip_range texture, 85 passed, 2 ignored. New tests: setting_two_drops_a_second_level_only_from_very_large_textures, host_mip_range with two levels dropped, and a_texture_made_without_two_levels_gets_the_levels_below (Metal: the host texture's level 0 receives the title's level 2).
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings (on main b998bb65 with this commit)
  • Ran the game: not done here. Measuring it as Sandile-0511 and ItsMariusBC did for =1 (heap_set_mb, failed command buffers, lowest memory level) would show what the second level adds and what it costs in sharpness up close.

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md (none: this is a host-side memory shortcut, documented as such)
  • New diagnostics are behind a VICTORY_* variable and documented (no new variable; VICTORY_TEXTURE_DROP_TOP_MIP gains the value 2)
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5533381783 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/469). Originally posted by [Hayyan612](https://github.com/Hayyan612) on 2026-11-27T21:35:57Z. --- ## What this changes Follow-up to the top-mip drop (#348, merged): `VICTORY_TEXTURE_DROP_TOP_MIP=2` also makes a sampled-only 2D texture whose larger side is at least 4096 texels, and that has two levels below its top, without its top two levels: a quarter of the width and height, about 94% of its memory. Textures from 1024 to 4095 still lose one level, a texture always keeps at least one, and `=1` is unchanged. Off by default, like `=1`. The upload, the background job, the view mapping (`host_mip_range`) and the copies (`host_mip` in 80a012f1, `mip - dropped_levels()`) already take any number of dropped levels; the selection now takes the setting's level instead of a flag. Docs: `docs/native-host.md` and `docs/metal-backend.md`. Refs #347 ## How it was tested - [ ] `cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory`: not run; the change is in `victory-gpu` only. Ran natively on arm64 instead: `cargo test -p victory-gpu --lib -- drop_top_mip a_texture_made_without host_mip_range texture`, 85 passed, 2 ignored. New tests: `setting_two_drops_a_second_level_only_from_very_large_textures`, `host_mip_range` with two levels dropped, and `a_texture_made_without_two_levels_gets_the_levels_below` (Metal: the host texture's level 0 receives the title's level 2). - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` (on main `b998bb65` with this commit) - [ ] Ran the game: not done here. Measuring it as Sandile-0511 and ItsMariusBC did for `=1` (`heap_set_mb`, failed command buffers, lowest memory level) would show what the second level adds and what it costs in sharpness up close. ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md (none: this is a host-side memory shortcut, documented as such) - [x] New diagnostics are behind a `VICTORY_*` variable and documented (no new variable; `VICTORY_TEXTURE_DROP_TOP_MIP` gains the value 2)
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
LakshanSivakumar/Native-Victory-macOS!469
No description provided.