mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 09:08:38 +00:00
game-gate: no run with a build the play script would make again for DLSS (D3D12-F1-DLSS-REBUILD)
The gate refuses to run without a build, because the play script would make it inside the run. Since the change before this one, play-nvidia.ps1 also makes a build noted as made without DLSS again once NVIDIA's SDK is there, whatever the start's switches ask for: on such a checkout that build too would be made inside the run, after the gate wrote down the exe's hash and what it was built with. The gate now refuses that run as well and names the build script. Not with -NoDlss in -PlayArgs (shortened or with :$true too) and not without cargo: the play script makes no build then. That commit's message calls this guard a follow-up, for want of PowerShell 7 on the PC it was written on; it has been installed since, and this is it. Checked with PowerShell 7.7.0: the guard's own lines against a synthetic folder, eleven cases; and the whole script twice. With a build noted as made without DLSS and the SDK there it refuses before anything starts (exit 1, no run folder). With a build noted as made with DLSS it goes on as before: run.json carries built_with, and the run ends at once with ERROR not_started, there being no game in the folder. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@ -8,7 +8,7 @@ The script is `scripts/game-gate.ps1` (Windows, PowerShell 7). The parser is `to
|
||||
|
||||
It needs PowerShell 7 (`pwsh`). Windows PowerShell 5.1 (`powershell.exe`) refuses the script with a message before anything runs, from its `#Requires -Version 7.0` line.
|
||||
|
||||
Build the runtime first (`d3d12\scripts\build-nvidia.ps1`). The gate refuses to start without `d3d12\target\diag\leonida.exe`, because the play script would build it inside the timed run.
|
||||
Build the runtime first (`d3d12\scripts\build-nvidia.ps1`). The gate refuses to start without `d3d12\target\diag\leonida.exe`, because the play script would build it inside the timed run. For the same reason it refuses a build noted as made without DLSS (`built-with.txt`) once NVIDIA's SDK is in `d3d12\nvidia-sdk`: the play script makes that build again with DLSS at its next start (not with `-NoDlss` in `-PlayArgs`, and not without cargo).
|
||||
|
||||
Make a data template once:
|
||||
1. Play to the place the runs should start from.
|
||||
|
||||
@ -56,6 +56,15 @@ $RunRoot = (Resolve-Path $RunRoot).Path
|
||||
# A run writes gigabytes of logs and a copy of the saves: never into a checkout.
|
||||
if (($RunRoot + '\').StartsWith($repo + '\', [StringComparison]::OrdinalIgnoreCase)) { throw "-RunRoot is inside the checkout: $RunRoot" }
|
||||
if (-not (Test-Path $exe)) { throw "no ${exe}: build it first (d3d12\scripts\build-nvidia.ps1), the play script would build it inside the run" }
|
||||
# The play script also makes a build noted as made without DLSS again once NVIDIA's SDK is there, whatever the start's
|
||||
# switches ask for (d3d12\scripts\play-nvidia.ps1; not with -NoDlss, and not without cargo): that build too would be
|
||||
# made inside the run, after the exe's hash and what it was built with were written down below.
|
||||
$builtWith = Join-Path $repo 'd3d12\target\diag\built-with.txt'
|
||||
$dlssSdk = Join-Path $repo 'd3d12\nvidia-sdk\DLSS\lib\Windows_x86_64\x64\nvsdk_ngx_d.lib'
|
||||
if ((Test-Path $builtWith) -and (Get-Content $builtWith -Raw) -notmatch 'dlss' -and (Test-Path $dlssSdk) -and
|
||||
$PlayArgs -notmatch '(^|\s)-NoD(l(s(s)?)?)?(:\$true)?(\s|$)' -and (Get-Command cargo -ErrorAction SilentlyContinue)) {
|
||||
throw "$exe was built without DLSS and NVIDIA's SDK is here: build it again first (d3d12\scripts\build-nvidia.ps1), the play script would do it inside the run"
|
||||
}
|
||||
if (-not $RunDir) { $RunDir = Join-Path $RunRoot ('{0}-{1}' -f (Get-Date -Format 'yyyyMMdd-HHmmss'), ($Name -replace '[^\w.-]', '_')) }
|
||||
|
||||
function Get-RunningGame {
|
||||
@ -115,7 +124,6 @@ $moreText
|
||||
"@
|
||||
|
||||
$gpu = Get-CimInstance Win32_VideoController | Sort-Object { [uint64]$_.AdapterRAM } -Descending | Select-Object -First 1
|
||||
$builtWith = Join-Path $repo 'd3d12\target\diag\built-with.txt'
|
||||
[ordered]@{
|
||||
name = $Name
|
||||
started_utc = (Get-Date).ToUniversalTime().ToString('o')
|
||||
|
||||
Reference in New Issue
Block a user