Repository navigation
GPU: VICTORY_TEXTURE_DROP_MIPS=N leaves out a texture's N largest levels on the host (8 GB cards) - #610
GPU: VICTORY_TEXTURE_DROP_MIPS=N leaves out a texture's N largest levels on the host (8 GB cards)#610ofc0urse wants to merge 5 commits into
Conversation
|
I reproduced a texture-to-buffer copy failure on this PR at 5971e08. With a retained mip on the second array slice, dropping one level left the destination untouched. The same copy succeeded with zero levels dropped. 81e1f7a is a cherry-pickable fix on this PR's head. It maps the retained source subresource before creating a host texture. The new D3D12 test checks the pixels, crop, row pitch, destination offset and surrounding bytes. It passes with both settings on Bazzite 44, RTX 5060 Laptop GPU (8 GB), NVIDIA 615.78.08, Proton Experimental 11.0-20261112 and vkd3d-proton 3.2.0. The wider resource suite passed 10/11 on both revisions with dropping disabled. The same depth-plane test failed during root signature creation on both. This result uses generated textures. Gameplay impact remains unverified. Code and testing assisted by OpenAI Codex (GPT-6.2-Sol). I also compared the setting itself during offline Series X loading, using one build of fork main 310c6eb with this PR and local Proton compatibility changes. Both runs used the same cache/profile seed, input, CPU cap and 50% texture-room setting. Around 90 seconds the renderer counted 7,510 title-filled textures using 2,342 MiB at zero levels dropped, versus 7,403 using 1,343 MiB with one dropped. Around two minutes it held 7,531 versus 15,388. Both showed loading artwork and a fade to black. The full-size run stopped at the VRAM reserve after 164 s. The reduced-size run stopped at the host RAM reserve after 168 s. These are single runs per setting. World entry and in-game performance remain unverified. |
|
RTX 3060 Laptop 6 GB / Windows 10 22H2 follow-up. The operator reported that the opening cutscene looked better with one mip level dropped, with dark/missing-looking surfaces and low frame rate still present. Builds: fxceless c96b4f2 + 310c6eb (packed-texture queue and reuploads at full budget) + Xeltax/VIcky#9 (integer render-target blending, adapted to both depth paths). The second build also includes #610 at 5971e08 and sets VICTORY_TEXTURE_DROP_MIPS=1. Both used Agility SDK 1.620.2, diagnostics, VICTORY_CARD_BUFFERS_MB=512, VICTORY_TEXTURE_GUARD=0, VICTORY_TEXTURE_NO_WAIT=1 and VICTORY_SHADER_LOOP_LIMIT=256. Both loaded an existing host pipeline library. The test was offline, with title data on an HDD.
What worked: The #610 build reached the world sooner in this pair, reduced the queue, and improved observed cutscene presentation. Separately, the blend backport turned the same E_INVALIDARG mesh pipeline into a successful creation on this GPU (VIctory #806 reproduction). The targeted blend, packed-neighbor and mip-view tests passed. What remained: The full-mip build still hit a large texture backlog after 310c6eb, even with the compilation queue empty. Dropping one mip still produced slow intervals and visible dark areas. In several later 3D intervals with zero pipelines being built, copy-back was still about 142–281 ms per frame. This makes waiting for pipeline compilation alone an unproductive next test for that section. I also checked whether VIctory's cd94d35/940d32f6 page-marked copy-back changes could be applied directly to this tree. They conflicted across the host, descriptor, and shader-emission paths, so they were not part of either run. The runs used successive pipeline caches and were not frame- or camera-matched. The table is an observational comparison, not an isolated speedup estimate. Upload counts are cumulative counters, not VRAM residency. |
|
Measured on an 8 GB card in the Series S profile, since that is what this is for. Setup. RTX 3050 8 GB, i5-12400F, 32 GB, Windows 11, release build. Tree:
So here Two things to know:
Not tested: AI-assisted: Claude Code (Claude Fable 5.2) made the runs and wrote this note. |
|
One more result for the 8 GB texture mode. With one mip dropped, the host texture shrank as intended, but a CPU refresh still read and hashed the omitted high-resolution data. An asset-free 512×512 RGBA8 test on this PR's head ( Cherry-pickable follow-up on this PR's head. It limits the CPU refresh to the retained mip range for single-slice 2D textures. The same texture then read 344,064 bytes. Changing only the excluded level left the upload clean. Changing a retained texel updated the expected staging byte and preserved its adjacent channels. With dropping off, the single-slice control still read 1,392,640 bytes. The two-slice control still read 2,785,280 bytes and preserved the original slice stride in both modes. The focused texture-memory suite passed 4/4 with dropping off and 4/4 with one mip dropped. The retained-layout test compares all output bytes for linear, 4 KiB tiled and 64 KiB tiled layouts, including packed mip tails. The asset policy passed across 169 files. These byte counts measure the synthetic texture. I haven't established a title-level loading-time or FPS gain. RTX 5060 Laptop GPU (8 GB), NVIDIA 615.78.08, Bazzite 44, Proton Experimental 11.0-20261112, vkd3d-proton 3.2.0 ( |
|
@Filip722 the title-level number you said was missing, for your follow-up
So here: no regression (both runs reach the world, picture as before, walls present in both), and no gain I can measure in either the settled frame time or the time the world takes to settle; both are inside the run-to-run spread on this base. The texture part of a settled frame is only 2 to 9 ms here, so there is little for it to save once the world is up; a gain would have to show while textures arrive, and with four runs I cannot see one. AI-assisted: Claude Code (Claude Fable 5.2) made the runs and wrote this note. |
|
A second card: RTX 3070 8 GB, Series X mode, N=1 5971e08 picked onto c96b4f2 + main 310c6eb (with #605 left out) and a number of other open PRs. The prologue's
Not tried: Setup: RTX 3070 8 GB (driver 621.24, 32-lane waves), Ryzen 5 3600, 32 GB, Windows 11, Series X mode, 1920x1080, relay at its default (stage 2), card buffers 1 / 1024 MB, a diagnostics build. |
GPU: VICTORY_* switches set to 0 are off (fxceless#610) (cherry picked from commit e82a6ad)
|
Integration note for rebasing #610 ( The merge builds. In I extracted the existing shape test unchanged and ran an asset-free Windows-target unit test in fresh GE-Proton11-14 processes on Linux. For a single-slice 1024×1024 RGBA8 texture with 11 levels, the invariant “a texture whose levels were dropped must not enter the unshifted tile path” passed at Conservative integration option: keep mip dropping on the existing non-reserved path for affected textures and keep on-demand tiling for the rest, until tile mapping supports the same title-to-host mip offset. No game or hardware tiling run, pixel readback, VRAM/FPS measurement, or wall-rendering claim here. AI disclosure: Hermes Agent inspected the merge, wrote and ran the regression test, and posted these results on ArturoWolff’s behalf. |
…els on the host On an 8 GB card the textures picked by index stop at the card's memory budget with about 15,000 more due, and the GPU time per frame is about three times what it is when they fit (RTX 4060 Ti, first room). With the switch, host copies of 2D textures the title fills (at least 512 texels on the shorter side, sides halving into whole 4-texel blocks) leave out their N largest levels: staging detiles title level m + N into host level m, shader views shift their levels down, buffer-to-texture copies go to the level the host copy has, and other copies with such a texture are skipped. Off (0) by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: OpenAI Codex (GPT-6.2-Sol) (cherry picked from commit 81e1f7a80021f66068697e118e5aa01bc564c4de)
Keep the original title layout offsets for retained mip data and narrow the CPU refresh range for single-slice 2D textures. Preserve the title extent for residency and budget checks and keep array slice strides intact. Assisted-by: Codex (GPT-6.2-Sol) (cherry picked from commit 31694102841a09ec13cd8d4a14f36e49668bd664)
Levels on demand (VICTORY_LEVELS_ON_DEMAND=1) cuts a reserved texture into tiles by the title's level numbers, while a texture with VICTORY_TEXTURE_DROP_MIPS has a shorter host mip chain. Such a texture now takes the plain path, as ArturoWolff pointed out in the review of fxceless#610. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A copy between a texture whose host copy leaves out levels and another texture was skipped. A title level has the same size in every host copy that has it, so both sides now map to their own host subresource: - CopyTextureRegion maps the source subresource as it already mapped the destination; a level a side does not have is skipped. - CopyResource between host copies that leave out different numbers of levels copies each level both have (copy_levels); equal ones keep CopyResource. On an 8 GB card with VICTORY_TEXTURE_DROP_MIPS=1 the skipped copy left a static blocky patch on screen in the first room; with this change the patch is gone and the skip counter stays at 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Both fixes ran in the game here Both applied to our tree with line offsets only (3169410's test needed its The once-per-run line "copy with a texture whose host copy leaves out levels skipped" still fires; that is the Setup: RTX 3070 8 GB (driver 621.24, 32-lane waves), Ryzen 5 3600, 32 GB, Windows 11, Series S mode (PR #188), 1920x1080, |
5971e08 to
68e6f6a
Compare
|
Rebased onto
Same machine as before (RTX 4060 Ti 8 GB, driver 621.24, Series X profile, diagnostics build, warm cache, same automated walk into the first room). Settled minutes,
On the new main the switch no longer changes the frame time here: the card room work in One open problem I could not pin down. With
The same staircase edge appears on a character's shoulder with Not tested: other cards, scenes past the first room, levels on demand together with the switch, AMD, Wine. 🤖 Generated with Claude Code |
|
Verified the tile-eligibility part of your rebase ( I extracted the That resolves the specific predicate failure I reported. This test does not exercise the new copy commands or identify which pass draws the lower wall. AI-assisted: Hermes Agent wrote and ran the regression fixture, compared the results, and posted this follow-up for ArturoWolff. |
Problem
On an 8 GB card the textures picked by index do not fit. With the current main, the card sits at its memory budget (about 6.8 GB in use of 7.1 GB), about 15,000 textures stay waiting for room, and frames that pass the budget get slow: the GPU time per frame triples once the system starts moving card memory into the PC's.
Change
VICTORY_TEXTURE_DROP_MIPS=N(0 by default, at most 4): the host copy of a 2D texture the title fills leaves out its N largest levels. Each level left out is three quarters of the texture's bytes.Only textures where this is exact: 2D (arrays and cubes too), no render target, depth or UAV flag, single sample, at least 512 texels on the shorter side, and sides that halve into whole 4-texel blocks. Host level
mis then title levelm + Ntexel for texel.resource.rs:drop_levelsdecides per description;host_texturemakes the smaller copy;host_subresourcemaps a title subresource to the host one.texture.rs: the staging buffer is laid out from the host texture as before, and detiles title levelm + dropinto host levelm.descriptor/host.rs: shader views shift their first level, level count and LOD clamp down by the same amount (shift_levels, with a unit test). A view of only the left-out levels shows the largest level the host has.list.rs: a buffer-to-texture copy into such a texture goes to the level it has (none for a left-out level). Other copies and read-backs involving such a texture are skipped, logged once.texture::aliasfalls back to the title-memory upload when the two textures leave out different levels.Shaders see these textures at half size per level left out. Code that samples is unaffected apart from detail. Code that
Loads with integer coordinates computed from the title's own sizes can read out of range. I have not seen that in the first room.Measurements
RTX 4060 Ti 8 GB (driver 621.24), i5-14400F, 32 GB RAM, Windows 11, Series X profile, diagnostics build. Main
c96b4f2with #426 and #571 on top, default settings,VICTORY_TEXTURE_NO_WAIT=1, warm shader cache, same automated walk into the first room, 15 to 17 minutes each:DROP_MIPS=0DROP_MIPS=1Captured frames of the first room look right in both. With the switch, fine texture detail is softer (expected), and there is visibly less temporal smearing, from the shorter frames.
cargo build(diag and release) clean,cargo test -p victory-gpu views_shift_downpasses. Not tested: other cards, other scenes, AMD, Wine.Developed with Claude Code.
🤖 Generated with Claude Code