Skip to content

Parallelize independent Linux native shadow refreshes - #30

Open
gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/linux-native-parallel-refresh
Open

gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:contrib/linux-native-parallel-refresh

Conversation

@gmankab

@gmankab gmankab commented Nov 26, 2026

Copy link
Copy Markdown

The Linux native RX 6800 trace spent 28 ms per heavy frame in memory moves. Each batch can refresh separate host mappings in parallel while preserving the order of each mapping's ranges. The submitting thread joins every refresh before a title write, GPU write reservation, or submission. The preparation counter records elapsed batch time.

The switch VICTORY_WIDE_REFRESH=1 enables workers for batches of at least four host mappings. It stays opt-in pending gameplay testing. Fxceless #38 has a Windows report of missing geometry with parallel refreshes enabled. Fxceless report

Five interleaved runs on the Linux native integration reduced the median 44 MiB flush from 5.97 to 3.86 ms on RX 6800 mapped buffers and from 5.94 to 3.89 ms on Lavapipe. A separate paired check on the exact PR head measured 6.80 to 4.53 ms on the RX 6800. All fixture runs checked that every requested byte was copied and the gaps between disjoint requests stayed unchanged. The exact PR head passed 46 regular GPU tests on Lavapipe. These are copy timings. Gameplay speed and visual correctness with the switch enabled remain open.

Depends-on: #10
Based-on: fxceless/victory-fork#38
Based-on: fxceless/victory-fork@ceb9e1f
Tested-on: RX 6800 and Lavapipe, Fedora Linux 45, Linux native vkd3d-proton
Assisted-by: gpt-6.2 sol xhigh

DoubleD17 and others added 2 commits November 26, 2026 01:19
A submission can request disjoint pieces of a shadow buffer. Refreshing
their bounding interval also copies the unrequested bytes between them
and can overwrite a stale gap before the title asks for it.

Port the interval union from the Windows implementation to this batch's
refresh queue. Keep the single interval inline and merge touching or
overlapping requests before their existing flush point. A native D3D12
test checks that two 64 KiB requests leave the intervening 64 KiB at its
old value until a later request covers it.

Based-on: fxceless/victory-fork#591
Based-on: Marvisak#1818
Reported-by: pablogonz12 (Marvisak#185)
Tested-on: RX 6800 and Lavapipe, Fedora Linux 45, native VKD3D-Proton
Assisted-by: gpt-6.2 sol xhigh
Submission profiling spent 28 ms per heavy frame in memory moves. A batch can refresh several independent host mappings as long as the ranges of each mapping stay ordered and all work joins before a title write, GPU write reservation, or submission.

Adapt the Fxceless worker approach to the Linux native batch and its disjoint intervals. Enable it with VICTORY_WIDE_REFRESH=1 for batches of at least four host copies. Record elapsed batch time alongside the bytes copied, so parallel work does not inflate the preparation counter.

Five interleaved runs of the 44 MiB fixture on RX 6800 mapped buffers cut median flush time from 5.97 to 3.86 ms. Lavapipe measured 5.94 to 3.89 ms. The fixture verifies every byte and checks the gap between disjoint ranges at the title-write barrier.

Based-on: fxceless/victory-fork#38
Based-on: fxceless/victory-fork@ceb9e1f
Tested-on: RX 6800 and Lavapipe, Fedora Linux 45, Linux native vkd3d-proton
Assisted-by: gpt-6.2 sol xhigh
gmankab added a commit to gmankab/gta6-wiki that referenced this pull request Nov 26, 2026
Publish the alternating copy timings and functional readback checks for RADV and Lavapipe. Link the opted-in implementation and its prerequisite so the effect on mapped buffers can be reproduced separately from gameplay.

Based-on: spidercraft/VIctory#30
Tested-on: RX 6800 and Lavapipe, Fedora Linux 45
Assisted-by: gpt-6.2 sol xhigh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants