Log which shader converter was loaded (#295) #300

Merged
m0rff merged 1 commit from upstream-pr/300 into main 2026-11-27 10:37:28 +00:00
m0rff commented 2026-11-27 09:34:41 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T09:34:41Z.


Refs #295

The reporter's suggestion only: the start-up log now names the converter it loaded and where the path came from, and warns when it is not Apple's default.

  • metal: shader converter <path> <size> <mtime> (from VICTORY_MSC_DYLIB | the installed default), logged once per run (msc::try_open_default).
  • A warning when the path is not /usr/local/lib/libmetalirconverter.dylib. The variable set to the default path itself is not warned about. An empty VICTORY_MSC_DYLIB now counts as unset, as it already did in native-setup.sh.
  • No version is logged. The library does not expose one: its Mach-O current version is 0.0.0, and the C API has no version call. (There is an undocumented C++ symbol IRCompilerGetBinaryVersion(unsigned char*), but its buffer size and format are unknown, so it is not called.)
  • This does not try to fix the missing art.

Does the shader cache key tell converters apart? Yes. The Msc id (path, file size, modification time) is part of every library cache key (convert_with and mesh_threads), so a different converter path, or a replaced file at the same path, gets its own cache entries. Nothing changed there.

Tests: msc::tests::the_converter_path_is_the_override_if_set_else_the_default, msc::tests::the_load_note_names_its_source_and_warns_only_off_the_default_path. Docs: docs/native-host.md, next to the shader cache's library keys.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5524374075 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/300). Originally posted by [m0rff](https://github.com/m0rff) on 2026-11-27T09:34:41Z. --- Refs #295 The reporter's suggestion only: the start-up log now names the converter it loaded and where the path came from, and warns when it is not Apple's default. - `metal: shader converter <path> <size> <mtime> (from VICTORY_MSC_DYLIB | the installed default)`, logged once per run (`msc::try_open_default`). - A warning when the path is not `/usr/local/lib/libmetalirconverter.dylib`. The variable set to the default path itself is not warned about. An empty `VICTORY_MSC_DYLIB` now counts as unset, as it already did in `native-setup.sh`. - **No version is logged.** The library does not expose one: its Mach-O current version is 0.0.0, and the C API has no version call. (There is an undocumented C++ symbol `IRCompilerGetBinaryVersion(unsigned char*)`, but its buffer size and format are unknown, so it is not called.) - This does not try to fix the missing art. **Does the shader cache key tell converters apart?** Yes. The `Msc` id (path, file size, modification time) is part of every library cache key (`convert_with` and `mesh_threads`), so a different converter path, or a replaced file at the same path, gets its own cache entries. Nothing changed there. Tests: `msc::tests::the_converter_path_is_the_override_if_set_else_the_default`, `msc::tests::the_load_note_names_its_source_and_warns_only_off_the_default_path`. Docs: `docs/native-host.md`, next to the shader cache's library keys.
LakshanSivakumar commented 2026-11-27 10:37:43 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T10:37:43Z.


Thank you. Merged.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7216114213 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/300#issuecomment-7216114213). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T10:37:43Z. --- Thank you. Merged.
Sign in to join this conversation.
No reviewers
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!300
No description provided.