Advance native Windows RR integration, kernel tooling and local packaging

Implement native NGX feature-13 RR through a LUID-matched D3D12/Vulkan
shared-memory and timeline-fence bridge. Add owned parameter snapshots,
GPU resource lifetime handling, inherited/enhanced barriers, optional
guides, sampled input formats and depth-plane support with stencil
preservation. Separate RR initialization from the SR CUDA runtime and
expose explicit backend/model selection through player configuration.

Add synthetic bridge, snapshot and NGX lifecycle harnesses covering
camera/history/reset, parameter mutation, delayed submission, early
release, capability gating and unsupported-input rejection.

Add exact gfx11 D/E model generation, verified caches, versioned local
deployment with configuration backups, and isolated portable model
tools with pinned Python, NumPy and glslang dependencies.

Extend Windows K benchmarking and private native-cache selection.
Fix LLVM 22 emitter/helper compatibility and preserve exact-output
validation for local output-kernel optimization.

Add native FSR RR provider diagnostics, local development package
refresh tooling, installer/checker updates, FidelityFX headers and
Windows parity documentation.

Keep NVIDIA binaries, derived models and private optimized kernels out
of distributable packages. Native RR evidence remains synthetic;
game validation, FSR RR dispatch, installer integration and Linux
performance parity remain incomplete.
This commit is contained in:
ayo committed 2026-10-16 12:53:26 -04:00
1 parent 3345fffcd3
commit 247fe1092d
60 files changed
+7168 -66

No files matched your search

@@ -0,0 +1,57 @@
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)][string]$DlssDll,
[Parameter(Mandatory=$true)][string]$NativeDirectory,
[Parameter(Mandatory=$true)][string]$OutputDirectory,
[string]$HipRoot,
[string]$EmitterRoot,
[string]$GpuArch='gfx1101',
[string]$Kernel='hiluma_engine_output_depthreg_mvhi_ldr_max_v2_rel'
)
$ErrorActionPreference='Stop'
. (Join-Path $PSScriptRoot 'gpu-target.ps1')
$repo=[IO.Path]::GetFullPath((Join-Path $PSScriptRoot '../..'))
[void](Get-D4RGpuTargetInfo $GpuArch)
$DlssDll=(Get-Item -LiteralPath $DlssDll).FullName
$NativeDirectory=(Get-Item -LiteralPath $NativeDirectory).FullName
$OutputDirectory=[IO.Path]::GetFullPath($OutputDirectory)
$buildRoot=[IO.Path]::GetFullPath((Join-Path $repo 'build'))+'\'
if(!$OutputDirectory.StartsWith($buildRoot,[StringComparison]::OrdinalIgnoreCase)){
throw 'Private generated kernels must stay under ignored build/.'
}
if(Test-Path -LiteralPath $OutputDirectory){throw 'Use a new private cache directory.'}
$expected='3975567b8943c53acce397f2b72380092f84f162d00b0d2c7d08a1025c563983'
if((Get-FileHash -LiteralPath $DlssDll).Hash.ToLowerInvariant() -ne $expected){throw 'Expected pinned DLSS SR 310.9.1.'}
if(!$HipRoot){$HipRoot=Join-Path $repo '.tools/therock-10.2.0a20260929/_rocm_sdk_core'}
if(!$EmitterRoot){$EmitterRoot=Join-Path $repo 'dist/zluda-windows-emitter'}
$objects=@(Get-ChildItem -LiteralPath $NativeDirectory -Filter '*.hsaco' -File)
if($objects.Count -ne 16){throw 'NativeDirectory must contain the baseline 11 K and 5 M objects.'}
foreach($family in @('k','m')){
foreach($source in Get-ChildItem -LiteralPath (Join-Path $repo "kernels/$family") -Filter '*.hip' -File){
if(!(Test-Path -LiteralPath (Join-Path $NativeDirectory ($source.BaseName+'.hsaco')))){
throw "Baseline native directory is incomplete: $($source.BaseName)"
}
}
}
foreach($object in $objects){Assert-D4RCodeObjectTarget $object.FullName $GpuArch}
& (Join-Path $PSScriptRoot 'build-native-texture.ps1') -DlssDll $DlssDll -Kernel $Kernel `
-HipRoot $HipRoot -ZludaRoot $EmitterRoot -GpuArch $GpuArch -OutputDirectory (Join-Path $OutputDirectory 'texture')
if($LASTEXITCODE){throw 'Private texture build failed.'}
$native=Join-Path $OutputDirectory 'native'
New-Item -ItemType Directory -Path $native | Out-Null
foreach($object in $objects){Copy-Item -LiteralPath $object.FullName -Destination $native}
foreach($marker in @('d4r-native-fp8.txt')){
if(Test-Path -LiteralPath (Join-Path $NativeDirectory $marker)){
Copy-Item -LiteralPath (Join-Path $NativeDirectory $marker) -Destination $native
}
}
Copy-Item -LiteralPath (Join-Path $OutputDirectory "texture/$Kernel.hsaco") -Destination $native
& python (Join-Path $repo 'kernels/tools/kernel_manifest.py') $native $DlssDll
if($LASTEXITCODE){throw 'Private native manifest generation failed.'}
@{schema=1; architecture=$GpuArch; privateNvidiaDerivedCode=$true; nativeDirectory=$native;
dlssSha256=$expected; kernel=$Kernel; validation='built only; validate complete frames before game use';
files=@(Get-ChildItem -LiteralPath $native -File | ForEach-Object {
@{name=$_.Name; sha256=(Get-FileHash -LiteralPath $_.FullName).Hash}
})} | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $OutputDirectory 'cache.json') -Encoding UTF8
Write-Host 'Private cache built; no game or existing configuration changed.'
Write-Host "After validation, set [Paths] NativeDir = $native"