GPU: check a sampled texture once per submission, not once per list #79
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/79"
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 Marvisak/VIctory. Originally posted by TG0000 on 2026-11-24T00:16:53Z.
What
A title texture's staging refresh (
texture::Staging::refresh) ran as a host step of every list that sampled it. When several lists in one submission sample the same texture, it was checked again for each list. In physical-page memory, which cannot be write-watched, each check is aVirtualQuerywalk (texture::committed) plus a blake3 hash of the whole texture.Checks after the first one in a submission did nothing:
CopyTextureRegionreads the same staging buffer, andrun_deferredfor every list, thenExecuteCommandLists).So a second check could change only what the GPU reads if title memory had been written in between.
How
Step::Texture(Arc<Staging>), added viaHostList::defer_texture. Before, they went through the genericdefer_hostclosure.Batch, which already merges buffer refreshes across lists, now also records the staging buffers it has refreshed (texture_due).Step::Copy(a write into title memory) andStep::Run(work that may write title memory) callBatch::title_written(). It flushes pending buffer refreshes, as before, and clears the texture record, so a texture is checked again after any such write. This is the same ruleStep::Refreshfollows ("once per submission … until aCopyorRunintervenes").GpuWritestill only flushes, because it doesn't write title memory.Two files:
crates/victory-gpu/src/host.rsandcrates/victory-gpu/src/texture.rs(theStagingtype and itsrefreshbecomepub(crate)).Benchmark (synthetic)
host::tests::texture_checks_per_submission(ignored) runs on one submission. It times the blake3 hashing done when each of 12 lists checks the same 48 textures of 4 MiB, then the same with the new per-submission check. The list and texture counts are made up, not measured from a title.The real gain depends on how many lists of a world submission sample the same physical-page textures. This PR doesn't measure that, because the title wasn't run.
Tests
a_texture_is_checked_once_per_submissionandtitle_writes_make_textures_due_again.cargo test --workspace(stable MSVC): all pass.cargo clippy --workspace --all-targets: same 16 warnings asmain, none in the changed code.cargo fmt --check: no new diffs.mainalready has rustfmt diffs invictory-gpu; those remain.cargo xtask policy:asset policy: 150 files ok.No game data is in the commit, the tests or this description.
AI-assisted (Claude Code).
🤖 Generated with Claude Code
upstream-sync referenced this pull request2026-11-24 06:51:26 +00:00
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:57:57Z.
Tested
73d776bunder Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build withcargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.\n\n-victory_gpu: 38 passed, 3 failed, 1 ignored; the three are the environment-only failures (argument_clamp_builds,a_rejected_blob_gives_an_empty_library, #128's upload skip).\n- The change is a per-submission deduplication, and the suite still passes with it.\n\nNo game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).