GPU: small textures are cut from texture blocks of their own #1543
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1543"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by tikD1337 on 2026-11-28T21:26:35Z.
Summary
With
VICTORY_POOL_SMALL=1, textures that may lie at multiples of 4 KiB were cut from the same pool blocks as textures at multiples of 64 KiB. On an RTX 4070 Ti SUPER (Series S profile) the walls of the house in the prologue were black from their first frame, on every run, with nothing in the log.This gives the small textures a pool of their own (
SMALLbesideTEXTURES):room()reclaims both pools;texture_room()and the memory line count both;Reclaim::to, which main already carries);VICTORY_POOL_SMALL_APART=0restores the old behaviour (same blocks).Without
VICTORY_POOL_SMALL=1nothing changes: no texture is placed at 4 KiB, so nothing goes to the new pool.Related: #1491 turns
VICTORY_POOL_SMALLon in the launcher. On this card, that switch on its own gives the black walls described here.Why separate blocks
To find the cause I wrote a probe (not part of this PR): it placed ten kinds of the title's small textures side by side at 4 KiB in one heap on the card, eight of a kind and one of each, and read them back. All of them kept their own bytes, so 4 KiB placement as such is fine on this card. What was left was a small texture sharing a 64 KiB stretch of a block with a 64 KiB-aligned texture. With the two kinds kept apart, the walls were correct on every run.
Before / after
Same build, same save and settings, Series S, run to the prison and 60 s past it:
POOL_SMALL=0POOL_SMALL=1, same blocksPOOL_SMALL=1, this PRThe VRAM and private-bytes figures come from a build that also had the soft texture budget (I'll send that as a separate PR). The difference between the last two columns is this change alone. No device loss or driver event in any of these runs.
Test plan
cargo test --release --locked -p victory-gpu: 551 passedcargo test --profile diag --locked -p victory-gpu --features diagnostics: 605 passedsmall_textures_are_cut_from_blocks_of_their_owncargo clippygives no new findings inpool.rsAI-assisted: the investigation, the code and this description were written with Claude Code; the runs were played on the setup above.
Labels:
pr-fix,rendering,memory,NVIDIA,series-s🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by pickles976 on 2026-11-29T07:41:58Z.
Adapted
f590af8b93onto our older Wine performance branch, retaining its configurable block size and original retirement/submission-age rules:github.com/pickles976/VIctory-NVIDIA@fb92449bd3. This is not an exact-head test. The adaptation also combines both pools in the existing census.Wine 11 / Linux 6.17 / RTX 4060 Laptop 8 GiB / NVIDIA 590.48.1 / stock app-local vkd3d 2576c0b4adfae4a, raw-access chains disabled as in our title configuration. Fresh intended-tree build17.86s. Fourteen pool ownership/copy tests pass (0 ignored, 0.81s), including original-pool COM release, live/resting reuse exclusion and full texture updates.
A separate strict physical-NVIDIA test passes1/1 in0.66s: production texture/staging allocation, actual 4 KiB native alignment and non-64-KiB small offset, distinct small/ordinary native heaps, two256x256 BC1 textures with7mips, native-footprint uploads, and14 finite HLSL Texture2D.Load dispatches. All349504 packed RGBA texel results match across two rounds; rewriting only the first texture preserves every neighboring texel. Final HELD/LIVE and each pool’s free/resting ownership return correctly. The large64-KiB-aligned texture is allocated for heap-separation proof, not sampled. No physical GPU stall, original-title shader execution, concurrent descriptor-publication certification or title memory/FPS result claimed.
The initial compile-only attempt had a local fixture reference-comparison typo, corrected before these runs. Existing play defaults remain unchanged pending a guarded title observation with small placement and separation enabled together; all resource guards remain.
Local evidence: verify-nvidia-small-pool-build-fixed-20261129T073838Z, verify-nvidia-small-pool-lifetime-stock-20261129T073936Z, verify-nvidia-small-pool-mips-stock-20261129T073938Z. Fixture source is in the linked commit; no assets or game imagery published.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by pickles976 on 2026-11-29T07:57:59Z.
Changed-title follow-through on the disclosed adaptation is incomplete, not a rendering verdict. The 30 s startup showed the picker with no kernel fault. The later loading trial stopped at ~99 s on our unchanged 2 s native-NVML deadline, before any high-draw report. The independent native observer also took 3670 ms across that interval, so this is not merely nvidia-smi process-start overhead.
A 379362704-byte submission-upload allocation began at07:45:41.018312Z and had no return log before termination. During the overlap the submission thread was sampled in mempool_alloc_noprof then rq_qos_wait; telemetry waited in os_acquire_rwlock_read. This does not prove the native lock writer, allocation result, or that pool isolation caused it. The same deadline class had occurred on an earlier build without this port. No Xid was observed; an ioctl-copy error followed scope kill. Scope peak9GiB/max317/oom0; last successful guard GPU4079MiB/RAM available4757MiB. All safety limits retained, no unchanged retry.
Last completed pool census before the stop:25122textures/1319MiB held,22×64MiB blocks/85MiB free/2MiB resting/0empty. This is not a matched-stage saving or proof of correct world rendering. The offscreen sampling/lifetime passes above remain valid. Next separate gate is retired-upload reuse for the large native allocation, not relaxing telemetry deadlines. Local evidence nvidia-fork-trial-20261129T074407Z/{verified-summary,allocation-wait-window,backing-cleanup}.json; identified stopped backing cleanup completed.