From 0d52eb7df4b2af2ff6018d0afe5dc85231f65e70 Mon Sep 17 00:00:00 2001 From: Ake Rehnman Date: Sat, 26 Sep 2026 19:30:44 +0200 Subject: [PATCH] viogpu3d: make Yttrium12 packaging opt-in Only include the native DX12 UMD when YTTRIUM12_DLL_x64 is explicitly set. Otherwise omit its DLL and INF copy/registration entries while preserving the existing DX9/DX10/DX11 registrations. Remove stale Yttrium12 payloads from staging and the WDK package when switching to a build without it. Keep validation for explicitly supplied payloads so missing, invalid or non-AMD64 DLLs still fail the build. Validated Win10 and Win11 x64 builds and catalog generation with the payload enabled and disabled, including incremental enabled-to-disabled builds. Checked all five INX templates and invalid payload rejection. --- viogpu/viogpu3d/tools/prepare_package_inx.ps1 | 16 ++++++++++++---- viogpu/viogpu3d/viogpu3d.vcxproj | 14 ++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/viogpu/viogpu3d/tools/prepare_package_inx.ps1 b/viogpu/viogpu3d/tools/prepare_package_inx.ps1 index 3aa0b4d3..92cf27b6 100644 --- a/viogpu/viogpu3d/tools/prepare_package_inx.ps1 +++ b/viogpu/viogpu3d/tools/prepare_package_inx.ps1 @@ -17,9 +17,10 @@ if (-not (Test-Path -LiteralPath $SourcePath)) { } $sourceName = [System.IO.Path]::GetFileName($SourcePath) -if ($sourceName -like 'viogpu3d_x64*') { - if ([string]::IsNullOrWhiteSpace($Yttrium12Path) -or - -not (Test-Path -LiteralPath $Yttrium12Path -PathType Leaf)) { +$yttrium12Present = $sourceName -like 'viogpu3d_x64*' -and + -not [string]::IsNullOrWhiteSpace($Yttrium12Path) +if ($yttrium12Present) { + if (-not (Test-Path -LiteralPath $Yttrium12Path -PathType Leaf)) { throw "Missing x64 Yttrium12 payload: $Yttrium12Path. Build yttrium12 first and set YTTRIUM12_DLL_x64." } @@ -62,6 +63,13 @@ if ($hasWow64Payload -and -not $wow64LvpPresent) { } $lines = [System.IO.File]::ReadAllLines($SourcePath) +if (-not $yttrium12Present) { + # Drop the optional DX12 slot without removing the DX9/DX10/DX11 entries + # on the same registry lines. The remaining matches are file entries. + $lines = $lines -replace ',%11%\\yttrium12\.dll\s*$', '' + $lines = $lines -replace ',yttrium12\s*$', '' + $removeTokens += @('yttrium12_x64.dll') +} if ($removeTokens.Count -ne 0) { $pattern = ($removeTokens | ForEach-Object { [regex]::Escape($_) }) -join '|' $lines = @($lines | Where-Object { $_ -notmatch $pattern }) @@ -75,4 +83,4 @@ if (-not (Test-Path -LiteralPath $destinationDir)) { $utf8NoBom = New-Object System.Text.UTF8Encoding($false) [System.IO.File]::WriteAllLines($DestinationPath, $lines, $utf8NoBom) -Write-Host "Prepared $DestinationPath (native Lavapipe=$nativeLvpPresent, wow64 Lavapipe=$wow64LvpPresent, Yttrium12=$Yttrium12Path)" +Write-Host "Prepared $DestinationPath (native Lavapipe=$nativeLvpPresent, wow64 Lavapipe=$wow64LvpPresent, Yttrium12=$yttrium12Present)" diff --git a/viogpu/viogpu3d/viogpu3d.vcxproj b/viogpu/viogpu3d/viogpu3d.vcxproj index 596c8d82..764fe64d 100644 --- a/viogpu/viogpu3d/viogpu3d.vcxproj +++ b/viogpu/viogpu3d/viogpu3d.vcxproj @@ -462,12 +462,14 @@ $(IntDir)messa_stage\ - $(MSBuildProjectDirectory)\..\..\..\yttrium12\yttrium12.dll - - - + + + + + + @@ -513,7 +515,7 @@ x64 - + x64 @@ -619,7 +621,7 @@ x64 - x64 + x64 x64 x64 x64