perf(victory-gpu): opt-in budget-aware mip-tail clamping (default OFF) #555
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/555"
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 LooperSalty/AnyXboxX. Originally posted by Vladimir-Human on 2026-11-27T21:40:49Z.
Summary
Opt-in (
VICTORY_TEXTURE_AUTO_MIP_CLAMP=1, default OFF) budget-aware host mip-tail clamping rebased ontomain(132da61,#563+#564), ported fromfxceless/victory-forkandavatarmanz/VIctory-7900XTX.Default-OFF Parity & Scope
texture::staging()leaves the default path (VICTORY_TEXTURE_AUTO_MIP_CLAMPunset/0) identical tomain: the extra shape predicate,clamp_host_sizecomparison, and keep-newer staging branch only run whentexture_mip_clamp::enabled()is true (covered bytexture::staging_tests).copy.tiled.is_some()andVICTORY_GPU_DETILErouting match132da61.#564slot eviction, bindless feedback eviction, and allocation retry paths.Known Limitations (Lossy by Design)
level0 > 0) and rebasing the SRV (MostDetailedMip,MipLevels,ResourceMinLODClamp) alters what shaders observe in explicitLoad(.., mip),GetDimensions, and texel-size math whenVICTORY_TEXTURE_AUTO_MIP_CLAMP=1is enabled.rebind_unclampedupdates static/mirrored descriptor slots when a staging copy later uploads wider mip ranges, but intentionally skips dynamic-table snapshots — recorded but unsubmitted command lists may retain descriptors referencing the displaced host resource, relying onhost::retirekeeping the displaced resource alive until its GPU fences complete.Verification
Verified locally on Windows 11 (
third_party/victoryworkspace) after the final edit:cargo xtask policy(381 files ok)cargo clippy --no-deps -p victory-gpu --locked --all-targets(default &--features diagnostics: 0 errors, 0 own warnings)VICTORY_D3D12_WARP=0) and WARP (VICTORY_D3D12_WARP=1, withVICTORY_TEXTURE_AUTO_MIP_CLAMPunset):texture::staging_tests: 2/2 passedresource::texture_mip_clamp::tests: 5/5 passeddescriptor::host::mip_clamp_tests: 1/1 passedtexture::detile_fallback_tests: 2/2 passed (both default andVICTORY_GPU_DETILE=1)resource::tests::slot_eviction: 2/2 passedresource::tests::refused_texture_allocation_has_one_retry: 1/1 passedChecklist
Source:/Co-authored-by:trailers +THIRD_PARTY.mdrow; ported fromfxceless/victory-fork&avatarmanz/VIctory-7900XTX)VICTORY_TEXTURE_AUTO_MIP_CLAMP=1required to activate)rebind_unclampeddynamic-snapshot lifetimeImported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T21:58:52Z.
Thanks for making the clamp opt-in. Before an in-game test:
Source:/Co-authored-by:trailers,THIRD_PARTY.mdis unchanged, and the checklist says no code was taken. Please fix all three.texture.rsstaging()changes regardless ofVICTORY_TEXTURE_AUTO_MIP_CLAMP: the cache hit now also compareson_demand,level0,mipsand host size, a new "keep the old staging" branch was added, andon_demandnow comes fromcopy.tiledinstead ofhost_tiled(resource). Please gate it, or say it changes the default path and add a test that fails on main.Load(.., mip),GetDimensionsor texel-size maths see in shaders. Please say in the description that the mode is lossy, and thatrebind_unclampedskips dynamic-table snapshots, so recorded but unsubmitted lists may still hold the displaced copy's descriptors (and relies onhost::retirebeing fence-aware).This conflicts with #354 in
host.rs,resource.rsandtexture.rs(take_staged,keep_whole,staging()); whichever lands second needs a rebase.Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-28T00:15:39Z.
Main just took #563 (the VIctory copy moved to Vice-Tay
4f15f09e) and #564 (memory stack), and this PR now conflicts inthird_party/victory/crates/victory-gpu/src/resource.rs,third_party/victory/crates/victory-gpu/src/texture.rs. Please rebase on current main, rerun the tests for the files you touch, and force-push.Imported from LooperSalty/AnyXboxX. Originally posted by Vladimir-Human on 2026-11-28T07:20:16Z.
Rebased onto
main(132da61, preserving#563ȴ) and addressed all three review items at commitded34e9:Source:/Co-authored-by:trailers to the commit, added the French row inTHIRD_PARTY.md, and corrected the PR checklist to acknowledge code adapted fromfxceless/victory-forkandavatarmanz/VIctory-7900XTX.mainwhen OFF: Gated the extratexture.rsstaging()cache-hit checks (on_demand,level0,mips,clamp_host_size) and the keep-newer staging branch behindtexture_mip_clamp::enabled()so the default path matches132da61(copy.tiled.is_some() andVICTORY_GPU_DETILEintact), verified withtexture::staging_tests(2/2 HW+WARP) andtexture::detile_fallback_tests(2/2 HW+WARP, default &VICTORY_GPU_DETILE=1).Load(.., mip),GetDimensions, and texel-size math, and thatrebind_unclampedskips dynamic-table snapshots and relies on fence-awarehost::retire.All touched-file tests passed on both HW and WARP after the rebase (policy 381 ok, hunk-accurate
clippydefault &diagnostics0 own warnings,texture_mip_clamp5/5,mip_clamp_tests1/1,slot_eviction2/2,refused_texture_allocation_has_one_retry1/1). Note: rebased before#354; once#354merges/rebases we'll keep them aligned.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.