mirror of
https://github.com/readmet3xt-lab/foxhound.git
synced 2026-12-06 08:58:36 +00:00
Windows 10's own Direct3D 12 stops at Shader Model 6.5 and refuses the root signatures with directly indexed descriptor heaps that every translated shader uses. victory.exe now exports D3D12SDKVersion and D3D12SDKPath, so Direct3D 12 loads Microsoft's newer runtime (the D3D12 Agility SDK's D3D12Core.dll) from a D3D12 folder beside it. The version is set first thing in main (d3d12.dll is delay-loaded so it reads that value): the folder's D3D12Core.dll version when there is one, else Windows' own (System32's, at most 614). So Windows 11 without the folder keeps its own runtime; the first version of this (reverted before v0.8.1) asked for 620 and stopped there with D3D12_ERROR_INVALID_REDIST. `victory get-d3d12` (scripts\get-d3d12.ps1) fetches the runtime from nuget.org and keeps it only when Microsoft signed it; on Windows 10 without it the launcher offers to fetch it before the first start. From foxhound PR #26 by Schrubbdiwupp (tested on Windows 10 22H2 with an RTX 5070 Ti). The version matching follows trustno1-coder/VIctory-NVIDIA's apps/victory/src/main.rs (GPL-3.0-or-later). A launcher comment's path held two control characters; fixed. Co-Authored-By: Schrubbdiwupp <23741214+Schrubbdiwupp@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
2.6 KiB
PowerShell
48 lines
2.6 KiB
PowerShell
# Fetches Microsoft's D3D12 Agility SDK runtime (D3D12Core.dll) for Windows 10.
|
|
#
|
|
# Windows 10's built-in Direct3D 12 stops at Shader Model 6.5 and refuses the root signatures with directly
|
|
# indexed descriptor heaps that every translated shader uses ("Unsupported bit-flag set (root signature flags
|
|
# c00)"). victory.exe exports D3D12SDKVersion and D3D12SDKPath (apps\victory\src\agility.rs), so Direct3D 12
|
|
# loads a newer runtime from a D3D12 folder beside it when there is one. Windows 11 needs none of this.
|
|
#
|
|
# .\scripts\get-d3d12.ps1 into agility\D3D12 (git-ignored; build-launcher.ps1 -Package copies it)
|
|
# .\scripts\get-d3d12.ps1 -Dir <folder> into <folder>\D3D12, e.g. the folder of your victory.exe
|
|
#
|
|
# The package comes from nuget.org (Microsoft.Direct3D.D3D12, about 20 MB); the DLL is kept only when it is
|
|
# validly signed by Microsoft. The version must match D3D12SDKVersion in agility.rs (1.620.x = 620).
|
|
param(
|
|
[string]$Dir,
|
|
[string]$Version = '1.620.2'
|
|
)
|
|
$ErrorActionPreference = 'Stop'
|
|
$repo = Split-Path $PSScriptRoot -Parent
|
|
if (-not $Dir) { $Dir = Join-Path $repo 'agility' }
|
|
$target = Join-Path $Dir 'D3D12'
|
|
New-Item -ItemType Directory -Force $target | Out-Null
|
|
|
|
$url = "https://api.nuget.org/v3-flatcontainer/microsoft.direct3d.d3d12/$Version/microsoft.direct3d.d3d12.$Version.nupkg"
|
|
$package = Join-Path ([IO.Path]::GetTempPath()) "microsoft.direct3d.d3d12.$Version.nupkg"
|
|
Write-Host "Microsoft's Direct3D 12 runtime $Version (the D3D12 Agility SDK) from nuget.org"
|
|
Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $package
|
|
try {
|
|
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
|
$zip = [IO.Compression.ZipFile]::OpenRead($package)
|
|
try {
|
|
foreach ($name in 'D3D12Core.dll', 'LICENSE.txt') {
|
|
$path = if ($name -like '*.dll') { "build/native/bin/x64/$name" } else { $name }
|
|
$entry = $zip.Entries | Where-Object FullName -eq $path
|
|
if (-not $entry) { throw "the package has no $path" }
|
|
[IO.Compression.ZipFileExtensions]::ExtractToFile($entry, (Join-Path $target $name), $true)
|
|
}
|
|
} finally { $zip.Dispose() }
|
|
} finally { Remove-Item $package -ErrorAction SilentlyContinue }
|
|
|
|
$dll = Join-Path $target 'D3D12Core.dll'
|
|
$signature = Get-AuthenticodeSignature $dll
|
|
if ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notmatch 'O=Microsoft Corporation') {
|
|
Remove-Item $dll -Force
|
|
throw "D3D12Core.dll is not validly signed by Microsoft ($($signature.Status)); not kept"
|
|
}
|
|
Write-Host (' {0} {1:N1} MB, version {2}, signed by Microsoft' -f $dll, ((Get-Item $dll).Length / 1MB),
|
|
(Get-Item $dll).VersionInfo.FileVersion)
|