Fix most tree and prop flicker on AMD: move off-16-byte raw twins on every driver #36
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/ReTerryDavis--ReVIctory!36
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-36"
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?
@staticman256 on GitHub · 2026-12-04 00:21 UTC · original
staticman256:raw-twin-move→main· +469 −8 · 2 files · 1 commits · merged 2026-12-04 00:29 UTCFix most tree and prop flicker on AMD: move off-16-byte raw twins on every driver
On an RX 9070 XT, trees, bushes, fences and poles were seen blinking constantly: single
objects missing for one frame, all the time, standing still or moving. Most of that is
removed by this PR. The cause is not specific to one card, so other GPUs and drivers
that show the same flicker are expected to be helped as well.
What was wrong
The game's lists of objects to draw are kept in buffers, and many of those lists do not
start on a 16-byte boundary. A raw buffer view in D3D12 has to. That is already handled
in ReVIctory (
6c0bbb3,VICTORY_MOVE_CACHED_TWINS): the raw twin is made from the 16bytes below and the descriptor is then edited to shift it to the real start
(
move_raw).Only a descriptor that is recognised is edited by
move_raw: address, then byte count,in the first 12 bytes. That is what is written by RX 7000 drivers. Something else is
written by the RX 9070 XT's driver, so every one of those moves was refused and the twin
was left null. A null twin is read as zeros, which is an empty list to the game, so
whatever that list held was not drawn that frame.
It had been reported in the log all along:
What is changed
One descriptor layout is no longer assumed. The layout of the running driver is found
once at start (
raw_layout, called fromprobe_view_limit):their descriptors are compared to find the address field and the length field
(
raw_layout_of). Every other byte has to be equal, or the layout is not used.what lies behind it is examined. This is the RX 9070 XT case: the handle points at a
32-byte record (pointer, stamp, resource, offset), and the address and byte count are
found behind the first pointer.
things are checked: the move shows, it is carried by copies (also into a
shader-visible heap), and the neighbouring slots and the same view in another slot
are left untouched.
The known layout is still tried first by
move_raw, exactly as before, and the probedone is only fallen back to (
move_raw_probed). On a driver whose layout is the knownone, nothing is changed. On a driver where the probe fails, nothing is changed either:
the twins stay null as they do today, and that is said in the log.
Two files are touched:
crates/victory-gpu/src/descriptor/host.rsand its tests(+469 -8).
Switches
VICTORY_RAW_MOVE_PROBE10: only the known layout is used, as before this PR.2: a probed layout is used even if it could not be proven by the read-back from a shader-visible heap.VICTORY_OFF16_COPIES1: shader views that start off 16 bytes are given their own copy that starts on 16 bytes, so no move is needed. Memory is spent on it and views written by shaders are not covered. Meant as a fallback for a driver the probe cannot read; it is also the diagnostic by which the cause was confirmed.How the cause was found
Ancient Souzou: lists that
start off 16 bytes were being read as zeros. The right place was pointed at by that.
The same repair was already present in ReVIctory, so the question became why it did
not help on this card.
was refused every time on this driver.
VICTORY_OFF16_COPIES=1(aligned copies,no move needed). Null off-16 twins were thereby confirmed as the cause before any
descriptor was touched.
address were found in them, which is why the pointer is followed in the second step
and the move is proven with a trial.
What to look for in a log
The first line is ended by one of four verdicts: the known layout, another layout
understood, behind a pointer, or not understood. The descriptors are also printed in
hex, so a log from a card where it fails is enough for the probe to be extended. With
VICTORY_STATS_LOG=1the "(N null)" counter is expected to read 0.Tested
RX 9070 XT, Windows 11, diag build,
play.ps1defaults with FSR 4 performance, raytracing and frame generation, tested before the rebase onto current
main:trial checks true, and the first move is logged about 30 seconds in.
Not tested
and Intel were not run; the probe is only acted on where upstream's
move_rawrefuses.
VICTORY_RAW_MOVE_PROBE=2and the "another layout, understood" path (address andlength directly in the descriptor but at other offsets): written, never met.
Not fixed by this
A whole row of trees can still be seen to vanish for one frame every few seconds. That
is a separate fault: it is removed by
VICTORY_THIN=0(orVICTORY_THIN_THREADS=1), soit is a timing problem between the threads by which thin lists are translated, not a
null view. It is not addressed here.
Claude Fable 5.2/High
@staticman256 on GitHub · 2026-12-04 00:27 UTC · original
cc: @SovietBearz0r strongly suggest bringing this in. This fixes both tree/prop flash and the LOD fade in/out.
cc: @ReTerryDavis same. Also please see the note about VICTORY_THIN at the bottom.