native: VICTORY_TEXTURE_DROP_TOP_MIP=2 also drops a second level of very large textures #469
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/469"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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=2also 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=1is unchanged. Off by default, like=1.The upload, the background job, the view mapping (
host_mip_range) and the copies (host_mipin80a012f1,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.mdanddocs/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 invictory-gpuonly. 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_rangewith two levels dropped, anda_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 mainb998bb65with this commit)=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
VICTORY_*variable and documented (no new variable;VICTORY_TEXTURE_DROP_TOP_MIPgains the value 2)