upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/main.cpp')
-rw-r--r--runtime/src/main.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp
index 21551e948..c8545f338 100644
--- a/runtime/src/main.cpp
+++ b/runtime/src/main.cpp
@@ -10,11 +10,11 @@
10// The same mapping, then each loaded DLL's TLS callbacks and DllMain(DLL_PROCESS_ATTACH) are run. 10// The same mapping, then each loaded DLL's TLS callbacks and DllMain(DLL_PROCESS_ATTACH) are run.
11// 11//
12// gta6rt --precompile-pipelines [--threads N] [--big-threads N] [--big-bytes N] [--all] [--smallest-first] 12// gta6rt --precompile-pipelines [--threads N] [--big-threads N] [--big-bytes N] [--all] [--smallest-first]
13// [--limit N] [--min-bytes N] [--max-bytes N] [--filter PART]... [--list] 13// [--limit N] [--min-bytes N] [--max-bytes N] [--filter PART]... [--skip-listed] [--list]
14// No game: creates the Vulkan device as --run does and builds every compute pipeline of the shader library 14// No game: creates the Vulkan device as --run does and builds every compute pipeline of the shader library
15// (LEONIDA_SHADERS) into the pipeline journal and the driver's cache, so a title's first dispatch of a large one 15// (LEONIDA_SHADERS) into the pipeline journal and the driver's cache, so a title's first dispatch of a large one
16// does not stall it. Resumable: entries already journaled are skipped (--all: built anyway). See 16// does not stall it. Resumable: entries already journaled are skipped (--all: built anyway). Programs named by
17// shims/d3d12_precompile.h. 17// LEONIDA_SKIP_COMPUTE are built too unless --skip-listed is given. See shims/d3d12_precompile.h.
18// 18//
19// gta6rt --run <exe> [--game-dir DIR] [--overlay DIR] [--trace-d3d12] [--trace FILE] [-- game arguments...] 19// gta6rt --run <exe> [--game-dir DIR] [--overlay DIR] [--trace-d3d12] [--trace FILE] [-- game arguments...]
20// The same, then the EXE's own TLS callbacks and its entry point, on a game thread. The game's argv and 20// The same, then the EXE's own TLS callbacks and its entry point, on a game thread. The game's argv and
@@ -177,6 +177,7 @@ void start_title_peek(std::uint8_t* base) {
177} // namespace 177} // namespace
178 178
179#include "base_reservation.h" 179#include "base_reservation.h"
180#include "compile_gate_policy.h"
180#include "code_hooks.h" 181#include "code_hooks.h"
181#include "cpu_emulation.h" 182#include "cpu_emulation.h"
182#include "host_cpu.h" 183#include "host_cpu.h"
@@ -262,7 +263,7 @@ int usage() {
262 " gta6rt --init <image> [--game-dir DIR] [--overlay DIR] [--mods DIR] [--archetype-lookup RVA[,ARG]] [--view-mode-getter RVA] [--trace-d3d12] [--trace FILE]\n" 263 " gta6rt --init <image> [--game-dir DIR] [--overlay DIR] [--mods DIR] [--archetype-lookup RVA[,ARG]] [--view-mode-getter RVA] [--trace-d3d12] [--trace FILE]\n"
263 " gta6rt --first-run-ui <exe> [--game-dir DIR] [--overlay DIR] [--trace FILE]\n" 264 " gta6rt --first-run-ui <exe> [--game-dir DIR] [--overlay DIR] [--trace FILE]\n"
264 " gta6rt --run <exe> [--game-dir DIR] [--overlay DIR] [--mods DIR] [--archetype-lookup RVA[,ARG]] [--view-mode-getter RVA] [--trace-d3d12] [--trace FILE] [-- game arguments...]\n" 265 " gta6rt --run <exe> [--game-dir DIR] [--overlay DIR] [--mods DIR] [--archetype-lookup RVA[,ARG]] [--view-mode-getter RVA] [--trace-d3d12] [--trace FILE] [-- game arguments...]\n"
265 " gta6rt --precompile-pipelines [--threads N] [--big-threads N] [--big-bytes N] [--all] [--smallest-first] [--limit N] [--min-bytes N] [--max-bytes N] [--filter PART]... [--list] [--via-helper]\n" 266 " gta6rt --precompile-pipelines [--threads N] [--big-threads N] [--big-bytes N] [--all] [--smallest-first] [--limit N] [--min-bytes N] [--max-bytes N] [--filter PART]... [--skip-listed] [--list] [--via-helper]\n"
266 " gta6rt --compile-server [--parent PID] [--threads N] [--idle-threads N] [--idle-exit SECONDS]\n"); 267 " gta6rt --compile-server [--parent PID] [--threads N] [--idle-threads N] [--idle-exit SECONDS]\n");
267 return 2; 268 return 2;
268} 269}
@@ -290,6 +291,7 @@ int precompile_main(int argc, wchar_t** argv) {
290 else if (a == L"--max-bytes") ok = number(i, options.max_bytes); 291 else if (a == L"--max-bytes") ok = number(i, options.max_bytes);
291 else if (a == L"--all") options.rebuild = true; 292 else if (a == L"--all") options.rebuild = true;
292 else if (a == L"--smallest-first") options.smallest_first = true; 293 else if (a == L"--smallest-first") options.smallest_first = true;
294 else if (a == L"--skip-listed") options.skip_listed = true;
293 else if (a == L"--list") options.dry_run = true; 295 else if (a == L"--list") options.dry_run = true;
294 else if (a == L"--via-helper") options.via_helper = true; 296 else if (a == L"--via-helper") options.via_helper = true;
295 else if (a == L"--filter" && i + 1 < argc) { 297 else if (a == L"--filter" && i + 1 < argc) {
@@ -389,6 +391,9 @@ int wmain(int argc, wchar_t** argv) {
389 if (argc > 1 && std::wstring(argv[1]) == L"--precompile-pipelines") return precompile_main(argc, argv); 391 if (argc > 1 && std::wstring(argv[1]) == L"--precompile-pipelines") return precompile_main(argc, argv);
390 if (argc > 1 && std::wstring(argv[1]) == L"--compile-server") return compile_server_main(argc, argv); 392 if (argc > 1 && std::wstring(argv[1]) == L"--compile-server") return compile_server_main(argc, argv);
391#endif 393#endif
394 // The title's process (not a build host above): LEONIDA_COMPILE_GATE=auto may calibrate the driver when the device
395 // is made (src/compile_gate_policy.h).
396 leonida::compile_gate_policy::calibration_allowed = true;
392 std::filesystem::path image, game_dir, overlay_dir, mods_dir; 397 std::filesystem::path image, game_dir, overlay_dir, mods_dir;
393 uint32_t archetype_lookup_rva = 0; // --archetype-lookup RVA[,ARG]: the game's archetype lookup by hash 398 uint32_t archetype_lookup_rva = 0; // --archetype-lookup RVA[,ARG]: the game's archetype lookup by hash
394 int archetype_lookup_arg = 0; 399 int archetype_lookup_arg = 0;