Fix tree and prop flicker on AMD: move off-16-byte raw twins on every driver and list translation order #197
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/197"
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 eikkapine/jaxe. Originally posted by staticman256 on 2026-12-04T06:29:07Z.
Fix most tree and prop flicker on AMD: move off-16-byte raw twins on every driver, and translate thin lists in the title's order
Two commits. The first is a port of
ReVIctory PR 36 (merged there) to
the
amdbranch. The second, described at the end, removes what was left after it inReVIctory: a row of trees blinking every few seconds with thin lists on.
On an RX 9070 XT, trees, bushes, fences and poles were seen blinking constantly in
ReVIctory: single objects missing for one frame, all the time, standing still or moving.
Most of that was removed there by the first change. The same code path is present on this
branch, and 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
on this branch: the raw twin is made from the 16 bytes 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 is refused and the twin
is left null. A null twin is read as zeros, which is an empty list to the game, so
whatever that list held is not drawn that frame.
It is reported by the frame line in the log (numbers from ReVIctory on an RX 9070 XT):
(
mainis not affected in the same way: there a twin that cannot be moved is kept witha bias that shaders add,
JAXE_TWIN_BIAS. This branch has no such fallback, so the twinis null.)
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.
One file is touched:
crates/jaxe-gpu/src/descriptor/host.rs, with its tests(+470 -5). The shader translator is not touched, so shader caches stay valid.
Switch
JAXE_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.(ReVIctory's diagnostic switch
VICTORY_OFF16_COPIESwas not ported.)How the cause was found (in ReVIctory)
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, so the question became why it did not help on
an RX 9070 XT.
was refused every time on that driver.
(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. A line is also written where the
probe could not run at all (no device, buffer or heap). The descriptors are printed in
hex, so a log from a card where it fails is enough for the probe to be extended. In the
frame line above, the "(N null)" counter is expected to read 0.
Tested
"behind a pointer, understood and tried" was reported by the probe with all eight
trial checks true, the first move was logged about 30 seconds in, and the constant
flicker of single trees and props was gone.
amdfirst (0902398, RX 9070 XT, Windows 11, release build, thelauncher's settings with FSR 4 performance and frame generation): 300 to 700 raw
twins a frame that do not begin on 16 bytes were counted in the open world by the
frame line, every one of them null, and the flicker was seen.
x86_64-pc-windows-msvc(clippy,--all-targets) withno new warnings; the layout test passes.
Not tested
on RX 7000. NVIDIA and Intel were not run; the probe is only acted on where
move_rawrefuses.JAXE_RAW_MOVE_PROBE=2and the "another layout, understood" path (address andlength directly in the descriptor but at other offsets): written, never met.
Imported from eikkapine/jaxe. Originally posted by Skilletz-ttv on 2026-12-04T08:55:57Z.
Confirms the fix on RDNA2 (RX 6950 XT): the probe found this card's layout too
Applied to a local build of
amd@0902398with89bd07d's change tocrates/jaxe-gpu/src/descriptor/host.rs. Reporting because the PR lists only anRX 9070 XT as tested, and this is an older driver generation where the descriptor
layout is evidently not the RX 7000 one either — the probe read it correctly with
no modification.
Before — standing still at a spot with dense vegetation: ~20,000 raw twins a
frame, 745 of them not beginning on 16 bytes, 745 null. Continuous flicker of
individual trees and roadside props, near and far, every frame.
After — same spot, same settings:
Imported from eikkapine/jaxe. Originally posted by mahhnameisjeff on 2026-12-04T10:03:03Z.
Tested on an RX 6700 XT (RDNA2) on top of
amd: same problem there, and this fixes it.Before (hour-long run, open world): every raw twin off 16 bytes was null, ~650 per frame (e.g.
19091, of them 653.9 that do not begin on 16 bytes (653.9 null)).With this PR the layout is found at start ("behind a pointer, understood and tried: such twins are moved by it"), and none are left null:
The flicker of single objects is gone in game.
raw_layouts_are_found_or_left_alonepasses.Imported from eikkapine/jaxe. Originally posted by staticman256 on 2026-12-04T10:19:01Z.
im going to push a very performance-cheap part 2 of the fix that solves the remaining batch flashes with a different cause. please stand by
Imported from eikkapine/jaxe. Originally posted by staticman256 on 2026-12-04T10:25:18Z.
Updated with the KIlflash Pt.2 @mahhnameisjeff @Skilletz-ttv recommend retesting.
Imported from eikkapine/jaxe. Originally posted by dardack on 2026-12-04T14:41:23Z.
i always come back to this build over revictory, even with these fixes in Re, i still get some flickering of sky or random objects, but this did have random trees or poles pop, this seems to fix. just still trees are duller until close, and they have blocking around them, but that was in this build without or without commit.
Imported from eikkapine/jaxe. Originally posted by staticman256 on 2026-12-04T14:52:55Z.
Reverted to the original commit only due to performance concerns.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.