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

Closed
opened 2026-11-26 14:43:49 +00:00 by github-bot · 1 comment
Owner

@⁠64bitMango on GitHub · 2026-11-26 11:17 UTC · original

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** on GitHub · 2026-11-26 11:17 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/44) 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:43:49 +00:00
Author
Owner

@⁠64bitMango on GitHub · 2026-11-26 11:19 UTC · original

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

**@⁠64bitMango** on GitHub · 2026-11-26 11:19 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/44#issuecomment-7190571435) Duplicate of #43 (posted more than once by a retry after a network timeout, sorry).
This discussion has been locked. Commenting is limited to contributors.
No description provided.