cpp-migration: add --rekey mode to compile_dxil as native equivalent of shader_cache_rekey.py #3012

Closed
opened 2026-11-27 05:06:43 +00:00 by stan495 · 0 comments
stan495 commented 2026-11-27 05:06:43 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-27T05:06:43Z.


Implements the native C++ equivalent of tools/startup/shader_cache_rekey.py directly in compile_dxil:

compile_dxil --rekey OLD_CACHE_DIR NEW_REQUEST_DIR [--jobs N]

  • Reads all graphics (.a), slot 67 compute (.c67), slot 57 mesh (.m57), and RTV variant (.rtv) requests from OLD_CACHE_DIR in parallel, counts .m86 markers, and ignores compiled results/diagnostics.
  • Recomputes current revision keys (x2w-startup-shader-28, x2w-startup-shader-28cs, x2w-startup-mesh-57-3) and rewrites .psin and .rtv payloads under the updated keys.
  • Fails with exit code 1 before creating/writing NEW_REQUEST_DIR if any request is incomplete, unreadable, or malformed; exits 2 on invalid usage or when OLD_CACHE_DIR and NEW_REQUEST_DIR are the same directory.
  • Publishes files atomically (ready markers last) without overwriting existing files in NEW_REQUEST_DIR.

Refs #2935

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6640364464 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3012). Originally posted by [stan495](https://github.com/stan495) on 2026-11-27T05:06:43Z. --- Implements the native C++ equivalent of `tools/startup/shader_cache_rekey.py` directly in `compile_dxil`: `compile_dxil --rekey OLD_CACHE_DIR NEW_REQUEST_DIR [--jobs N]` - Reads all graphics (`.a`), slot 67 compute (`.c67`), slot 57 mesh (`.m57`), and RTV variant (`.rtv`) requests from `OLD_CACHE_DIR` in parallel, counts `.m86` markers, and ignores compiled results/diagnostics. - Recomputes current revision keys (`x2w-startup-shader-28`, `x2w-startup-shader-28cs`, `x2w-startup-mesh-57-3`) and rewrites `.psin` and `.rtv` payloads under the updated keys. - Fails with exit code `1` before creating/writing `NEW_REQUEST_DIR` if any request is incomplete, unreadable, or malformed; exits `2` on invalid usage or when `OLD_CACHE_DIR` and `NEW_REQUEST_DIR` are the same directory. - Publishes files atomically (ready markers last) without overwriting existing files in `NEW_REQUEST_DIR`. Refs #2935
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
R0Y00/Xbox2Windows#3012
No description provided.