GPU: bound texture queue work and keep sampling on resident mips #1031
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1031
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1031"
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?
@Lkxex on GitHub · 2026-11-25 16:47 UTC · original
Lkxex:fix/streamed-mip-residency→main· +253 −124 · 4 files · 1 commits · openStreaming performance
The indexed texture pass can have 25,000–40,000 pending views while only consuming up to 4,096. Select the required newest retries and the newest/oldest fresh views before sorting. The pass receives exactly the same slot and write IDs in the same order.
For levels-on-demand textures, submit the mip mappings in one UpdateTileMappings call per backing heap. An upload can map several standard mip regions and a packed region in the same call. The original upload still runs after the mappings.
Sampling correctness
Tracking only the first resident mip leaves holes exposed when a finer mip and the coarse tail arrive before an intermediate mip. Texture views now select a contiguous run of initialized resident levels. If the requested range is wholly absent, temporarily select the nearest coarser mip or the coarsest finer mip. A change to any resident mip refreshes the views, including when the first resident mip stays the same. The tiled path remains opt-in through VICTORY_LEVELS_ON_DEMAND=1.
Verification
Optimized Windows build, Ryzen 5 5600, 40,000 queued views, 4,096 returned, median of 15 samples per case:
All 19 descriptor tests passed. The order comparison covers different retry mixes, delayed writes and limits, including zero and more than the queue length. The WARP tiled resource suite passed, including a shader readback that returned 0 through the legacy view and 32 through the resident view. That fixture mapped nine regions with one queue call instead of one per region. Native game frame times and hardware tile-mapping cost are unmeasured.
AI-assisted.
@tippythetaidum on GitHub · 2026-11-25 18:28 UTC · original
Tested with
VICTORY_LEVELS_ON_DEMAND=1on an RTX 5080 16 GB (driver 621.14, Windows 11, Ryzen 7 9800X3D, Series X profile), in the prison opening. With it, the black surfaces in the cell got their textures, and the card stayed below its line.Build: release build of
mainca8829fwith #24, #927, #823, #606, #1002, #907, #834, #1007 and this PR'sdb88f96, which picked cleanly. Two 600-second runs with the same switches (VICTORY_INDIRECT_WINDOW,COPY_PLAIN,JOIN_PARTS,BACK_OWN_VIEW,INDIRECT_GATHER,CARD_REHASH_RUNS,ASYNC_SUBMIT,QUEUE2,TEXTURE_NO_WAIT,HEAP_WORKERandCARD_ACCOUNTING, all=1), one without and one withVICTORY_LEVELS_ON_DEMAND=1.Card accounting:
Picture, saved frames of the same shots:
Frame rate, world frame lines: median 5.0 fps without and 5.8 fps with, 75th percentile 5.6 and 6.5. No errors and no device loss in either run.
I haven't run levels on demand without this PR, so I can't say how much of the change comes from the resident-run views and how much from levels on demand alone.
AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.
@teecil on GitHub · 2026-11-25 18:30 UTC · original
I reproduced one resource LOD clamp case on
db88f96with an RTX 3060 (driver 621.35) and WARP. With resident mask0b1110,show_residentselects mips 1–3 and changes a requestedResourceMinLODClampof 3.0 to 2.0. The adjusted view then samples mip 2 (48), while the original view samples mip 3 (64). Temporarily keeping the original clamp made both views return 64 on both adapters. Clamp adjustmentThe 19 descriptor tests and the existing WARP residency test also passed in my run. This additional probe uses an 8×8 committed texture to isolate the descriptor change. In this case the requested minimum is already inside the selected resident range, so it can stay in resource mip coordinates.
Test-only commit · Download patch
Set
VICTORY_TILES_TEST_CARDto0for WARP. AI-assisted, with local D3D12 verification.@Exopus-0x65f7ad0 on GitHub · 2026-11-25 20:42 UTC · original
Tested on RTX 5060 Ti 8 GB (Windows 11, 16 GB RAM, Series S) with
VICTORY_LEVELS_ON_DEMAND=1, merged cleanly onto forkmaind510ee4plus a dozen fork PRs. Lucia's face in the bar close-up of the opening cutscene now shows textured and lit. It was black in the G-buffer colour target in every earlier run; see #923. VRAM 7.2 → 6.9 GB. First room unchanged, median ~8 fps. No new artefacts seen in the cutscene or the first room.🤖 Generated with Claude Code
@Dathinel on GitHub · 2026-11-26 00:47 UTC · original · edited 2026-11-26 01:11 UTC
I tested #1031 together with the resource-coordinate clamp fix from #1210 on an RTX 3050 Laptop (4 GB) and WARP. With teecil's committed-texture probe, unmodified
db88f96returned 48 instead of 64 on WARP. After adapting #1210 to show_resident, both adapters returned [32, 16, 64, 64]. The separate missing-mip fixture still returned 32 through the resident view and 0 through the legacy view on both adapters, with the D3D12 debug layer enabled.Patch against db88f96 and reproduction. Synthetic readbacks only. Thanks to teecil for the probe and the #1210 author for the fix. AI-assisted.
Follow-up on the combination of a missing mip and a nonzero minimum: with only mips 1 and 3 marked resident and the minimum set to 3, the adjusted point-sampled view returned 0 on the RTX 3050 Laptop and 32 on WARP, while the original view returned 64. Selecting the resident run compatible with that minimum returned 64 on both adapters. Before/after table and reproducible fixture. Synthetic descriptor test only.
@ArturoWolff on GitHub · 2026-11-26 00:55 UTC · original · edited 2026-11-26 01:33 UTC
RTX 4060 8 GB / Proton baseline for the skin-residency reports here and #923. The existing on-demand switch alone did not restore the dark face in our opening night cutscene; it did allocate tiles and reduce the allocation required for unmapped levels. I have not applied #1031 or #1210 in this test. This is a receiving-tree baseline to justify testing the contiguous-resident-view fix, not a negative result against this PR.
Build: same previously verified paired-wave integration #854: base
51700c6d43a3507fa65e50fe4bb64074ce706cd4+ #1056c5820ac, #830951dc00, #20d4a36b1, #10064e7af7b; executable SHA-256a9f9c69e4382379fbb1d3f202b243840c75d23636c90356def6f27f5dc752be3. RTX 4060 8 GB, driver 620.73.04, 16 GB RAM, Linux, GE-Proton11-14 plus official vkd3d-proton71cae091b06571eoverlay, Series X, 1920x1080, file physical backing, texture guard=0/no-wait=1, pairing=1. No forced ray tracing.The two runs below used separate byte-identical copies of the prior paired-on run's initial prefix, saves, translation and driver cache seed (1,662 early keys). Verified file inventories and hashes; same executable and worker settings except adding
VICTORY_LEVELS_ON_DEMAND=1. Sequential runs, not a frame-synchronized benchmark. Both received a single controller A press/release at the visible account picker (47.07 and 47.33 s) and advanced to loading artwork, then the same night cutscene.shader does not translateWith levels on demand the actual device reported
tier=4 on=true floor_kb=1024. Last tiles line: 775 textures alive (1,463 made), 18 MB given to 361 levels, 1,803 MB not allocated for levels the title does not hold, pool heaps 64 MB. It still logged 433 uploads leaving a held level without memory (no room or no heap), retried 433; the indexed texture queue at that point had 23,143 slots, 16,817 due, 4,287 waiting for memory, 1,183 uploaded in part. These are internal allocation counters, not a measured 1.8 GB reduction in whole-GPU usage. Both arms logged the card-room warning and the 1,000,000-view heap cap. The final pending-pipeline count was zero in both. Both ended on schedule at about 333–336 s, no guard stop/OOM/Xid or matching device removal lines, no in-world controller response verified.Visible subtitles in both, including the same dialogue sequence. The on-demand arm reached a later recognizable intro credit overlay at the end; it does not prove a lighting or frame-rate fix, and the cutscene intervals were not 30 FPS gameplay. Audio PCM was present; fidelity unverified. No game captures or assets attached.
A separate earlier warmed pairing-off vs pairing-on comparison on the same build also showed dark faces in both arms despite the four targeted compute PSOs going from refused to successfully created (first-bind requests in both); the paired-on log had no translation failures, versus one
f133e35efed2a48arefusal to translate with pairing off. This strengthens the case for investigating texture/descriptor residency rather than treating those four Wave64 failures as the black-face cause. It does not identify which actual sampled texture is missing. The next useful experiment is #1031 plus #1210's resource-coordinate clamp correction (Dathinel's synthetic result above), holding pairing and cache warm-up fixed. A material diagnostic like #1204 may help distinguish unmirrored vs null vs nonresident slots if the face remains dark. Related RTX 4060 report: #1211.RTX 4060 8 GB / Linux-Proton follow-up: committed-texture clamp regression reproduced and corrected; retail dark faces remain. This follows the earlier receiving-tree baseline and Dathinel's synthetic findings. The committed-texture result below is local hardware execution, not WARP or native Windows.
I applied Lkxex's #1031
db88f96a6c940b33671c613eecf44c76f06a902bto the same private integrated #854 receiving tree (51700c6+ #1056c5820ac, #830951dc00, #20d4a36b1, #10064e7af7b). Then I used teecil's committed-texture probec1adcdcb0698a9e661e0504ac67ea3c93e86fc4f(only adapted its compiler-call signature) and Dathinel's54075521fee00e3c970adfda3113383f8e4e088badaptation of BradRoland's #12103b8dc4e0adb5e9869d52cc714127a5a3d7ffbfb3. Source repositories GPL-3.0. #1210 is now also reflected by fork main commit41f9857e, but these experiments are on the older exact receiving base, not that main commit.cargo test --locked --offline --target x86_64-pc-windows-gnullvm --release -p victory-gpu --lib --no-run; Rust 1.98.1 / LLVM MinGW. Ran the one ignored committed-texture test explicitly through GE-Proton11-14 with official vkd3d-proton71cae091b06571eoverlay, driver 620.73.04, verified live adapter RTX 4060, tiled resource tier 4, no D3D12 debug layer. Both used fresh copies of the same initial Wine prefix and empty explicit driver-cache directories; sequential guarded runs, no game. This is the fully committed texture fixture, not the tiled-hole fixture.[32, 16, 48, 64][32, 16, 64, 64]Test executables SHA-256 before
a956f91401044ec63268d78dfd20a1dfbf19e7585f53b7333a6cf2e98167c97d, aftercfa773a85a09bcf094a4974c5da419e0da5a3bc34d6561cf5a95a2a457116ae7. This confirms the distinct resource-coordinate bug on Linux/NVIDIA too. The separate tiled debug-layer test is not validated here. I have just seen Dathinel's newer combined missing-mip/nonzero-minimum result (9a81ed3); that additional selection correction is not in these executables.Retail follow-up: release diagnostics build SHA-256
5d67f437d592dee0265da893f43926f086aef976f34562395b82a79953b8172c, full receiving-tree patch SHA-25628caa53663a2672d1f42e0c02e26edb063b5703f1461193273b295434cb7eee9. Same Series X / 1920x1080 / file physical backing / texture guard 0 / no-wait 1 / pairing 1 / levels on demand 1 settings as earlier. Separate starting prefix, saves, translation-cache and driver-cache copies verified against the previous on-demand arm's seed (1,662 early keys). The build differs, so internal compilation/cache behavior need not be identical. No qualifying visible account picker: no automated A was sent; the game nevertheless advanced to the opening night cutscene. This is not a matched input or performance A/B.33 private game frames: title card at 187.0 s, recognizable nighttime geometry/subtitles, colored lights on clothing, dark/black faces and incorrect dark surfaces still present in close-ups around 287.6–297.4 s (overlay 0.5–0.6 FPS), no verified gameplay HUD or in-world input response. The earlier baseline also had dark faces and reached a readable intro credit overlay; credits were not captured in this candidate within the bound. Isolated application PCM nonzero in 8/20 sampled chunks; fidelity not verified. No logged
shader does not translateorhost pipeline refused, no logged device removal. Peak whole-device VRAM 7,522 MiB, scope RAM/swap 8,884/3,829 MiB, minimum host MemAvailable 1,876 MiB. Last tile line: 990 live, 18 MB in 358 levels, 2,168 MB hypothetical full allocation avoided; 238 uploads left held levels without card memory and 237 were recorded again. Scheduled stop at 335.8 s; memory guard remained active and host OOM counter unchanged.The synthetic clamp correction is real; this combined receiving-tree retail run does not establish that it restores the face. A next discriminating test is Dathinel's new missing-mip + nonzero-minimum fixture versus the already-corrected committed-texture case, followed by actual sampled material/descriptor evidence (#1204, #279) if the picture remains dark. No game assets, private paths or captures attached.
Further RTX 4060 / Proton readback: hole + resource minimum. I reproduced Dathinel's second case (
ad8db725ebdbf4045647e89b7d19fe40387f2fe6against their parent0aec241) on the receiving tree described above. Both arms have the same earlier #1031 + adapted #1210 correction and the same expanded committed-texture fixture; only the newshow_residentrun-selection change differs. The original compile-helper adaptation (&strarguments) was retained. GPL-3.0 provenance as above. Same Rust/LLVM MinGW release lib-test build, separate copies of the original Wine prefix, empty explicit driver caches, verified RTX 4060, GE-Proton11-14/vkd3d-proton71cae09, tier 4, no D3D12 debug layer.1110/ 31010/ 31010/ 2.75The contiguous case returned
[32,16,64,64]before and after. The integer hole case changed[32,16,0,64]to[32,16,64,64]with first mip/count changing 1/1 to 3/1; fractional case after also[32,16,64,64]. Before exited 101 at the expected assertion, after exited 0 with 1 passed, 0 failed, 0 ignored (all three readbacks executed). Executable SHA-256 before8a47f684ff1c4076f531dd8ac33892ff4d9ba2b8981db91f03c90ef6d32f2b91, afterc68ff909ea8aa1a6f580012d3a2acfddb1204c66aea69019aa930a03dbce5ec5. This is a committed fixture with a synthetic residency mask, not a reserved texture or real material sample.Retail candidate: same integrated base
51700c6plus the preceding patches andad8db725; release diagnostics exe413aa4ae39145aecd574b3dc0223b4db9900f9d8cb0e4a46884ae85b280acd6e(SHA-256), full tracked patch SHA-2569ae7ddc115cda06e448d252b4374ea67067712bb877a0e5752636e8cc303300c. Same verified initial profile/saves/cache bytes and settings as the previous retail trial. Neither run presented a qualifying visible account picker, so no automated A was sent in either; do not infer in-world control. 37 private frames, night establishing shot by 235.7 s, readable dialogue subtitles and dark character/world surfaces at 304.4–329.3 s (overlay readings 0.3 and 0.2 FPS). Faces were not shown in a comparable frontal close-up within this bound, so facial restoration is unverified, not a matched negative result for the exact face. No gameplay HUD or intro credits captured. Isolated app PCM 9/20 nonzero, fidelity unverified. Peak whole-device VRAM 7,375 MiB; scope RAM/swap 8,445/4,166 MiB; minimum host available 1,782 MiB. Last tile log 1,010 live, 49 MB in 476 levels, 457 held-level uploads lacked memory, 436 re-recorded. No shader translation/refusal or device-removal log lines; scheduled stop at 333.2 s, guard active and no host OOM. Different scene progression means these resource numbers do not establish an improvement in memory or speed.The hole-selection fix is independently confirmed for the point-sampled synthetic case. It does not establish correct skin/lighting or gameplay on this local retail path. Next I would collect actual material-slot and G-buffer evidence (#279, #1204, #923), rather than infer which sample is missing from the synthetic fixture. The texture-budget reports in #898 are another useful comparison. No captures/assets attached.
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High)
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.