upleb.uk

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

summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 16:55:04 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 16:55:04 -0500
commitdf92abca8ee2a8f9093efea7fcaa4dadc3ddaebc (patch)
tree97ef8f95544fe263049d3f7360823f16100de209 /scripts
parent49a0b69fcdb80db1f2a44ce7ca0ab8dfdec1e403 (diff)
parente5a7c8942678b323f655939c81f5d8855d20c248 (diff)
Merge main e5a7c8942 into shadow-aliased-guard (#1867)
One conflict, runtime/README.md: this branch rewrote the LEONIDA_SHADOW_ALIAS_MS row, main (#2163) added the LEONIDA_SHADOW_KEEP row after it. Both rows kept; the keep row's "aliased" now reads "aliased while they can't be guarded at every address", since aliased pages are no longer copied without a sign of a write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build_runtime.ps12
-rw-r--r--scripts/run_address_guard_gpu_test.py133
-rw-r--r--scripts/run_gpu_tests.py5
-rw-r--r--scripts/windows-boot/boot.ps110
4 files changed, 145 insertions, 5 deletions
diff --git a/scripts/build_runtime.ps1 b/scripts/build_runtime.ps1
index 5dd8bd389..bb25cccd7 100644
--- a/scripts/build_runtime.ps1
+++ b/scripts/build_runtime.ps1
@@ -86,7 +86,7 @@ $build || exit /b 1
86 Write-Warning "CMake and Ninja weren't found (neither VS C++ CMake tools nor native PATH tools): building with cl.exe directly, without the GameInput shim (SDL3) and without the Rust XMA2 decoder (XMA voices are silent). Install CMake + Ninja or VS's CMake tools component to get it." 86 Write-Warning "CMake and Ninja weren't found (neither VS C++ CMake tools nor native PATH tools): building with cl.exe directly, without the GameInput shim (SDL3) and without the Rust XMA2 decoder (XMA voices are silent). Install CMake + Ninja or VS's CMake tools component to get it."
87 $xtaskqueueDir = Join-Path $root "third_party\xtaskqueue" 87 $xtaskqueueDir = Join-Path $root "third_party\xtaskqueue"
88 $xtaskqueueFiles = "Source\Task\TaskQueue.cpp", "Source\Task\AsyncLib.cpp", "Source\Task\ThreadPool_win32.cpp", "Source\Task\WaitTimer_win32.cpp" | ForEach-Object { "`"$xtaskqueueDir\$_`"" } 88 $xtaskqueueFiles = "Source\Task\TaskQueue.cpp", "Source\Task\AsyncLib.cpp", "Source\Task\ThreadPool_win32.cpp", "Source\Task\WaitTimer_win32.cpp" | ForEach-Object { "`"$xtaskqueueDir\$_`"" }
89 $files = "src\main.cpp", "src\thread_stacks.cpp", "src\bcpack.cpp", "src\host_cpu.cpp", "src\pe_loader.cpp", "shims\registry.cpp", "shims\console_registry.cpp", "shims\file_system.cpp", "shims\xmem.cpp", "shims\xg_xs.cpp", "shims\acphal.cpp", "shims\d3d12_xs.cpp", "shims\d3d12_xs_device.cpp", "shims\d3d12_xs_pso_stream.cpp", "shims\d3d12_xs_rootsig.cpp", "shims\xgameruntime.cpp", "shims\xgameruntime_user.cpp", "shims\xgameruntime_gamesave.cpp", "shims\xgameruntime_store.cpp", "shims\xgameruntime_offline.cpp", "shims\winhttp_offline.cpp", "shims\ws2_offline.cpp", "shims\library_loader.cpp", "shims\process.cpp", "shims\lifecycle.cpp", "shims\xbox_bvh_builder.cpp", "shims\com_shim.cpp", "shims\silent_audio.cpp", "shims\bcrypt_rng.cpp", "shims\xapu_chad.cpp", "shims\dstorage.cpp" | ForEach-Object { "`"$src\$_`"" } 89 $files = "src\main.cpp", "src\thread_stacks.cpp", "src\bcpack.cpp", "src\host_cpu.cpp", "src\pe_loader.cpp", "shims\registry.cpp", "shims\console_registry.cpp", "shims\file_system.cpp", "shims\xmem.cpp", "shims\xg_xs.cpp", "shims\acphal.cpp", "shims\d3d12_xs.cpp", "shims\d3d12_xs_device.cpp", "shims\d3d12_xs_pso_stream.cpp", "shims\d3d12_xs_rootsig.cpp", "shims\xgameruntime.cpp", "shims\xgameruntime_user.cpp", "shims\xgameruntime_gamesave.cpp", "shims\xgameruntime_store.cpp", "shims\xgameruntime_offline.cpp", "shims\winhttp_offline.cpp", "shims\ws2_offline.cpp", "shims\library_loader.cpp", "shims\process.cpp", "shims\lifecycle.cpp", "shims\xbox_bvh_builder.cpp", "shims\com_shim.cpp", "shims\silent_audio.cpp", "shims\bcrypt_rng.cpp", "shims\xapu_queue.cpp", "shims\xapu_chad.cpp", "shims\dstorage.cpp" | ForEach-Object { "`"$src\$_`"" }
90 $includes = "/I `"$src\src`" /I `"$src\shims`" /I `"$src\shims\xtaskqueue`" /I `"$xtaskqueueDir\Include`" /I `"$xtaskqueueDir\Source\Task`" /I `"$xtaskqueueDir\Source\Common`"" 90 $includes = "/I `"$src\src`" /I `"$src\shims`" /I `"$src\shims\xtaskqueue`" /I `"$xtaskqueueDir\Include`" /I `"$xtaskqueueDir\Source\Task`" /I `"$xtaskqueueDir\Source\Common`""
91 $opt = if ($Debug) { "/Od /MDd" } else { "/O2 /MD" } 91 $opt = if ($Debug) { "/Od /MDd" } else { "/O2 /MD" }
92 $body = @" 92 $body = @"
diff --git a/scripts/run_address_guard_gpu_test.py b/scripts/run_address_guard_gpu_test.py
new file mode 100644
index 000000000..f7aa53366
--- /dev/null
+++ b/scripts/run_address_guard_gpu_test.py
@@ -0,0 +1,133 @@
1"""GPU test of the address guard (rdna2spirv.py --address-guard; docs/d3d12_vulkan.md, "Address guard").
2
3Assembles runtime/test/shaders/cs_address_guard.asm, translates it with --address-guard and runs it with
4vk_compute_test twice on a 2 MiB heap: once with the guard's header (the page table backs the arena and the page at
50x90000), once without its magic (the guard off). Every address the program uses is inside the heap's buffer, so
6neither run can fault, whatever the guard does: the guard-on run shows that the refused accesses read 0 and left
7memory alone although memory was there, and the guard-off run that the same module then reads it.
8
9 python -I scripts/run_address_guard_gpu_test.py --build runtime/build [--llvm-mc CMD] [--work DIR]
10
11Pin the GPU (MESA_VK_DEVICE_SELECT, VK_DRIVER_FILES) as for scripts/run_gpu_tests.py. Exit 0 when both runs give
12the expected words, 1 otherwise, 77 when vk_compute_test or llvm-mc is missing.
13"""
14import argparse
15import os
16import shutil
17import struct
18import subprocess
19import sys
20import tempfile
21
22ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
23sys.path.insert(0, os.path.join(ROOT, "tools"))
24import address_guard as ag # noqa: E402
25
26NAME = "cs_address_guard"
27HEAP_BYTES = 2 << 20
28LIMIT = ag.RESERVED_END # the "arena": offsets below it pass without a lookup
29TABLE = 0x100000 # the page table, inside the buffer but past the arena
30BACKED = [(0x90000, 0x91000)] # the one page outside the arena the table backs
31SEEDS = {0x90000: 0xA11CE000, 0x90004: 0xA11CE004, 0x90FFC: 0xF00DF00D, 0x91000: 0xF00DF00E,
32 0xA0000: 0xBADBAD00, 0xA0004: 0xBADBAD04, 0xA0008: 0xBADBAD08}
33# out[0..7] (cs_address_guard.asm's header) and other words after the run.
34EXPECTED_ON = [0xA11CE000, 0, 0, 0, 0, 0, 0xA11CE004, 0]
35EXPECTED_OFF = [0xA11CE000, 0xBADBAD00, 0xBADBAD08, 0xF00DF00D, 0xF00DF00E, 0xBADBAD00, 0xA11CE004, 0xBADBAD00]
36MEMORY_ON = {0xA0004: 0xBADBAD04, 0xA0008: 0xBADBAD08, # untouched
37 ag.DUMP + 4: 0x5707, ag.DUMP + 8: 1, # where the refused store and atomic went
38 ag.HEADER + 24: 6, # six refused accesses
39 ag.HEADER + 32: 0xA0000, ag.HEADER + 36: 0} # the last one, the s_load at 0xa0000
40MEMORY_OFF = {0xA0004: 0x5707, 0xA0008: 0xBADBAD09, ag.DUMP + 4: 0, ag.HEADER + 24: 0}
41
42
43def heap(guard_on):
44 """The heap's bytes: header (without the magic when not `guard_on`), seeds and page table; zero elsewhere."""
45 words = ag.table_words(BACKED)
46 end = TABLE + 4 * len(words)
47 assert end <= HEAP_BYTES
48 buf = bytearray(end)
49 hdr = bytearray(ag.header(LIMIT, TABLE))
50 if not guard_on:
51 hdr[0:8] = bytes(8)
52 buf[ag.HEADER:ag.HEADER + len(hdr)] = hdr
53 for at, value in SEEDS.items():
54 struct.pack_into("<I", buf, at, value)
55 struct.pack_into(f"<{len(words)}I", buf, TABLE, *words)
56 return bytes(buf)
57
58
59def find_tool(build, name):
60 for sub in ("", "RelWithDebInfo", "Release", "Debug"):
61 for ext in ("", ".exe"):
62 path = os.path.join(build, sub, name + ext)
63 if os.path.isfile(path):
64 return path
65 return None
66
67
68def main(argv=None):
69 ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
70 ap.add_argument("--build", default=os.path.join(ROOT, "runtime", "build"), help="folder with vk_compute_test")
71 ap.add_argument("--llvm-mc", default=os.environ.get("LLVM_MC", "llvm-mc"))
72 ap.add_argument("--work", default=None, help="keep the intermediate files here")
73 a = ap.parse_args(argv)
74 vk_compute = find_tool(a.build, "vk_compute_test")
75 if not vk_compute:
76 print(f"SKIP: no vk_compute_test under {a.build}")
77 return 77
78 if not shutil.which(a.llvm_mc.split()[0]):
79 print(f"SKIP: {a.llvm_mc} not found")
80 return 77
81 sys.path.insert(0, os.path.join(ROOT, "runtime", "test", "shaders"))
82 sys.path.insert(0, os.path.join(ROOT, "scripts"))
83 from compute_fixture import compute_header
84 import run_gpu_tests
85 work = a.work or tempfile.mkdtemp(prefix="leonida-guard-")
86 asm = os.path.join(ROOT, "runtime", "test", "shaders", NAME + ".asm")
87 for sub in ("disasm", "fssm", "spirv"):
88 os.makedirs(os.path.join(work, sub), exist_ok=True)
89 run_gpu_tests.assemble_to_s(a.llvm_mc, asm, os.path.join(work, "disasm", NAME + ".s"), NAME)
90 with open(os.path.join(work, NAME + ".dxbc"), "wb") as f:
91 f.write(run_gpu_tests.make_dxbc([]))
92 with open(os.path.join(work, "fssm", NAME + ".fssm"), "wb") as f:
93 f.write(compute_header(asm))
94 spirv = os.path.join(work, "spirv")
95 p = subprocess.run([sys.executable, "-I", os.path.join(ROOT, "tools", "rdna2spirv.py"),
96 os.path.join(work, "disasm"), "--out", spirv, "--address-guard"],
97 capture_output=True, text=True)
98 spv = os.path.join(spirv, NAME + ".spv")
99 if p.returncode != 0 or not os.path.isfile(spv):
100 print(p.stdout + p.stderr)
101 print("FAIL: translation")
102 return 1
103 failures = 0
104 for guard_on, expected, memory in ((True, EXPECTED_ON, MEMORY_ON), (False, EXPECTED_OFF, MEMORY_OFF)):
105 label = "guard on" if guard_on else "guard off"
106 init, dump = os.path.join(work, f"heap_{label[6:]}.bin"), os.path.join(work, f"dump_{label[6:]}.bin")
107 with open(init, "wb") as f:
108 f.write(heap(guard_on))
109 env = dict(os.environ, VKC_HEAP_INIT=init, VKC_OUT_WORDS=str(HEAP_BYTES // 4), VKC_DUMP=dump)
110 r = subprocess.run([vk_compute, spv, "1", "dump"], capture_output=True, text=True, env=env, timeout=120)
111 if r.returncode != 0 or not os.path.isfile(dump):
112 print(f"FAIL ({label}): vk_compute_test exit {r.returncode}\n{r.stdout}{r.stderr}")
113 failures += 1
114 continue
115 with open(dump, "rb") as f:
116 data = f.read()
117 word = lambda at: struct.unpack_from("<I", data, at)[0] # noqa: E731
118 got = [word(4 * k) for k in range(8)]
119 bad = [f"out[{k}] = {g:#x}, want {w:#x}" for k, (g, w) in enumerate(zip(got, expected)) if g != w]
120 bad += [f"[{at:#x}] = {word(at):#x}, want {w:#x}" for at, w in memory.items() if word(at) != w]
121 print(f"{'PASS' if not bad else 'FAIL'} ({label}): out = {' '.join(f'{g:#x}' for g in got)}")
122 for line in bad:
123 print(" " + line)
124 failures += bool(bad)
125 return 1 if failures else 0
126
127
128if __name__ == "__main__":
129 try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
130 sys.stdout.reconfigure(errors="replace")
131 except (AttributeError, ValueError, OSError):
132 pass
133 sys.exit(main())
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index f87290ec6..60e968783 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -1205,7 +1205,7 @@ def run_suite(a, work: str) -> int:
1205 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) 1205 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated()))
1206 elif name in ("cs_smem_vcc_base", "cs_store", "cs_signed_zero_nan", "cs_smem_soffset_imm", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap", "cs_w32_permlane_fi", "cs_exec_const", "cs_w32_mask_imm", "cs_w64_mask_imm", "cs_w32_lds_u8_d16", "cs_w32_lds_subdword", "cs_w32_lds_wide", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", "cs_wave64_ballot", "cs_wm_half_ops", "cs_wm_half_cmp", "cs_wm_bfm64", "cs_wm_scc_rfl", "cs_wqm_w64", "cs_wqm_w32", "cs_wqm_w64_half", 1206 elif name in ("cs_smem_vcc_base", "cs_store", "cs_signed_zero_nan", "cs_smem_soffset_imm", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap", "cs_w32_permlane_fi", "cs_exec_const", "cs_w32_mask_imm", "cs_w64_mask_imm", "cs_w32_lds_u8_d16", "cs_w32_lds_subdword", "cs_w32_lds_wide", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", "cs_wave64_ballot", "cs_wm_half_ops", "cs_wm_half_cmp", "cs_wm_bfm64", "cs_wm_scc_rfl", "cs_wqm_w64", "cs_wqm_w32", "cs_wqm_w64_half",
1207 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", 1207 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi",
1208 "cs_dpp_bound", "cs_dpp_cmp", "cs_dpp_w64", 1208 "cs_dpp_bound", "cs_dpp_cmp", "cs_dpp_cmpx", "cs_dpp_w64",
1209 "cs_w64_mask_detect", 1209 "cs_w64_mask_detect",
1210 "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute", 1210 "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute",
1211 "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw", 1211 "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw",
@@ -1274,6 +1274,7 @@ def run_suite(a, work: str) -> int:
1274 "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7], 1274 "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7],
1275 "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777], 1275 "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777],
1276 "cs_dpp_cmp": [3, 2, 3, 2, 1, 0, 1, 0], 1276 "cs_dpp_cmp": [3, 2, 3, 2, 1, 0, 1, 0],
1277 "cs_dpp_cmpx": [1, 1, 0, 0, 3, 3, 2, 2],
1277 "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], 1278 "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6],
1278 # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7] 1279 # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7]
1279 # without it 1280 # without it
@@ -1352,7 +1353,7 @@ def run_suite(a, work: str) -> int:
1352 "cs_bpermute32", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_w32_permlane_fi", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap", 1353 "cs_bpermute32", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_w32_permlane_fi", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap",
1353 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_wrxchg2_ext", "cs_w32_wrxchg2st64", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec", 1354 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_wrxchg2_ext", "cs_w32_wrxchg2st64", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec",
1354 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", 1355 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8",
1355 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_w32_andn2_exec", 1356 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_dpp_cmpx", "cs_w32_andn2_exec",
1356 "cs_w32_exec_computed") and not emulated and not partial 1357 "cs_w32_exec_computed") and not emulated and not partial
1357 if partial: 1358 if partial:
1358 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="32" if emulated else "64") 1359 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="32" if emulated else "64")
diff --git a/scripts/windows-boot/boot.ps1 b/scripts/windows-boot/boot.ps1
index 7863054b3..db11e4e76 100644
--- a/scripts/windows-boot/boot.ps1
+++ b/scripts/windows-boot/boot.ps1
@@ -50,7 +50,8 @@
50 50
51.PARAMETER InputScript 51.PARAMETER InputScript
52 LEONIDA_INPUT_SCRIPT: timed pad presses, seconds since the pad's first poll (button@seconds, comma-separated; 52 LEONIDA_INPUT_SCRIPT: timed pad presses, seconds since the pad's first poll (button@seconds, comma-separated;
53 buttons a b x y start back lb rb up down left right). Sets LEONIDA_KEYBOARD_PAD=always. Builds older than 53 buttons a b x y start back lb rb up down left right). Each press is held 300 ms; button@seconds:hold holds it
54 longer, e.g. b@1100:3 for a title that reads its pad only every few seconds. Sets LEONIDA_KEYBOARD_PAD=always. Builds older than
54 main @ 8146ef690 ignore a script longer than 63 characters. Default 'a@45,a@60,a@75,a@90'. 55 main @ 8146ef690 ignore a script longer than 63 characters. Default 'a@45,a@60,a@75,a@90'.
55 56
56.PARAMETER NoInput 57.PARAMETER NoInput
@@ -75,6 +76,9 @@
75.PARAMETER ExtraArgs 76.PARAMETER ExtraArgs
76 More gta6rt arguments, appended after the standard ones. 77 More gta6rt arguments, appended after the standard ones.
77 78
79.PARAMETER FirstRunUi
80 Launch with the offline first-run UI profile instead of the generic runtime profile.
81
78.PARAMETER Python 82.PARAMETER Python
79 Python 3.12+ used for tools/boot_trace.py. Default: python, else py -3. 83 Python 3.12+ used for tools/boot_trace.py. Default: python, else py -3.
80 84
@@ -118,6 +122,7 @@ param(
118 [switch]$NoCapture, 122 [switch]$NoCapture,
119 [switch]$NoInput, 123 [switch]$NoInput,
120 [string[]]$ExtraArgs = @(), 124 [string[]]$ExtraArgs = @(),
125 [switch]$FirstRunUi,
121 [string]$Python = "", 126 [string]$Python = "",
122 [int]$SummaryLines = 40, 127 [int]$SummaryLines = 40,
123 [int]$LockWaitSeconds = 3600, 128 [int]$LockWaitSeconds = 3600,
@@ -277,7 +282,8 @@ foreach ($pair in $EnvPairs) {
277} 282}
278if ($bootEnv["LEONIDA_CAPTURE"]) { $Capture = $bootEnv["LEONIDA_CAPTURE"] } 283if ($bootEnv["LEONIDA_CAPTURE"]) { $Capture = $bootEnv["LEONIDA_CAPTURE"] }
279 284
280$gameArgs = @("--run", $Exe, "--game-dir", $GameDir, "--overlay", $Overlay, "--trace", $TraceFile, "--trace-d3d12") + $ExtraArgs 285$launchMode = if ($FirstRunUi) { "--first-run-ui" } else { "--run" }
286$gameArgs = @($launchMode, $Exe, "--game-dir", $GameDir, "--overlay", $Overlay, "--trace", $TraceFile, "--trace-d3d12") + $ExtraArgs
281$argLine = ($gameArgs | ForEach-Object { ConvertTo-ProcessArgument ([string]$_) }) -join " " 287$argLine = ($gameArgs | ForEach-Object { ConvertTo-ProcessArgument ([string]$_) }) -join " "
282 288
283if (-not $DigestOnly) { 289if (-not $DigestOnly) {