The title writes most descriptor records with plain stores (~40k a frame); patching its store sites is an exact alternative to remirroring #45

Closed
opened 2026-11-26 11:17:47 +00:00 by 64bitMango · 1 comment
64bitMango commented 2026-11-26 11:17:47 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by 64bitMango on 2026-11-26T11:17:47Z.


From the Wine/D3DMetal ports of the same build (1.0.2.1), relevant to NativeHost::remirror_tables, which today checks the first 16 entries of each bound table.

What the title does in the world. It fills its shader-visible view heap (its frame allocator's memory, image +0x4d9f400) mostly with plain stores and memcpy, not device calls. Measured on the Windows forks: 60k-210k records copied a frame, about 40k a frame that no call announced (fxceless/victory-fork, upstream VIctory PR #305 by Flyander); 400k slots looked at, 40k mirrored a frame (avatarmanz/VIctory-7900XTX docs/findings.md). Checking only part of each table will miss many of them once the world renders.

What worked for them.

  1. Leave draws' own tables to the draws (avatarmanz 1f1a4336): the records a draw's or dispatch's table reads are made at the draw anyway, so a whole-heap sync can skip them; only slots that heap-indexing shaders read need mirroring. Their biggest single win: frame 280 -> ~124 ms.
  2. Patch the stores (avatarmanz 9997d255 and 4cb90bee, "renderer port 2"): draws' and dispatches' tables are filled by six 32-byte stores in image +0x4d9efd0 and +0x4eec8e0. Their launcher patches those stores (original bytes checked; a site that differs is left alone and logged) to jump to code that does the store and marks the slot, and also hooks the title's memcpy/memmove for records copied into the heap. The sync then takes the marked slots instead of scanning.

Since the native port runs the title in-process with no write watch, (2) looks like the natural fit: exact, and no per-draw checks.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6625501581 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/45). Originally posted by [64bitMango](https://github.com/64bitMango) on 2026-11-26T11:17:47Z. --- From the Wine/D3DMetal ports of the same build (1.0.2.1), relevant to `NativeHost::remirror_tables`, which today checks the first 16 entries of each bound table. **What the title does in the world.** It fills its shader-visible view heap (its frame allocator's memory, image +0x4d9f400) mostly with plain stores and memcpy, not device calls. Measured on the Windows forks: 60k-210k records copied a frame, about 40k a frame that no call announced (fxceless/victory-fork, upstream VIctory PR #305 by Flyander); 400k slots looked at, 40k mirrored a frame (avatarmanz/VIctory-7900XTX `docs/findings.md`). Checking only part of each table will miss many of them once the world renders. **What worked for them.** 1. *Leave draws' own tables to the draws* (avatarmanz 1f1a4336): the records a draw's or dispatch's table reads are made at the draw anyway, so a whole-heap sync can skip them; only slots that heap-indexing shaders read need mirroring. Their biggest single win: frame 280 -> ~124 ms. 2. *Patch the stores* (avatarmanz 9997d255 and 4cb90bee, "renderer port 2"): draws' and dispatches' tables are filled by six 32-byte stores in image +0x4d9efd0 and +0x4eec8e0. Their launcher patches those stores (original bytes checked; a site that differs is left alone and logged) to jump to code that does the store and marks the slot, and also hooks the title's memcpy/memmove for records copied into the heap. The sync then takes the marked slots instead of scanning. Since the native port runs the title in-process with no write watch, (2) looks like the natural fit: exact, and no per-draw checks.
64bitMango commented 2026-11-26 11:19:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by 64bitMango on 2026-11-26T11:19:10Z.


Duplicate of #43 (posted more than once by a retry after a network timeout, sorry).

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7190572353 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/45#issuecomment-7190572353). Originally posted by [64bitMango](https://github.com/64bitMango) on 2026-11-26T11:19:10Z. --- Duplicate of #43 (posted more than once by a retry after a network timeout, sorry).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS#45
No description provided.